N1570 states that this is undefined behavior:
§J.2/1 The value of an object with automatic storage duration is used while it is indeterminate (6.2.4
No. It's not undefined behaviour. Only ptr is uninitialized and has indeterminate value but &ptr has a proper value.
What the standard quote on strtol says:
...If the subject sequence is empty or does not have the expected form, no conversion is performed; the value of nptr is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
That above quote is talks about a call like this:
strtol(str, 0, 10);
The call in the man page and the linked answer are perfectly fine.