We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f62b47 commit 27b26bcCopy full SHA for 27b26bc
psycopg/typecast_datetime.c
@@ -286,7 +286,7 @@ static PyObject *
286
interval_from_usecs(const char *str)
287
{
288
PyObject *us = NULL;
289
- char *pend;
+ char *pend = NULL;
290
PyObject *rv = NULL;
291
292
Dprintf("interval_from_usecs: %s", str);
@@ -296,7 +296,7 @@ interval_from_usecs(const char *str)
296
goto exit;
297
}
298
299
- if (*pend != '\0') {
+ if (pend && *pend != '\0') {
300
/* there are trailing chars, it's not just micros. Barf. */
301
Dprintf("interval_from_usecs: spurious chars %s", pend);
302
PyErr_Format(PyExc_ValueError,
0 commit comments