diff --git a/ChangeLog b/ChangeLog index 3037f5d7..7be819a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-09-01 Federico Di Gregorio + * psycopg/pqpath.c: applied patch from intgr (#117) to fix + segfault on null queries. + * psycopg/cursor_type.c: applied patch from intgr (#116) to fix bad keyword naming and segfault in .executemany(). diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c index 7bceed20..1ebb569c 100644 --- a/psycopg/pqpath.c +++ b/psycopg/pqpath.c @@ -85,7 +85,7 @@ pq_raise(connectionObject *conn, cursorObject *curs, PyObject *exc, char *msg) #ifdef HAVE_PQPROTOCOL3 char *pgstate = PQresultErrorField(curs->pgres, PG_DIAG_SQLSTATE); - if (!strncmp(pgstate, "23", 2)) + if (pgstate != NULL && !strncmp(pgstate, "23", 2)) exc = IntegrityError; else exc = ProgrammingError;