]> granicus.if.org Git - php/commitdiff
- Fixed bug #53517 (segfault in pgsql_stmt_execute() when postgres is down)
authorFelipe Pena <felipe@php.net>
Fri, 10 Dec 2010 17:50:26 +0000 (17:50 +0000)
committerFelipe Pena <felipe@php.net>
Fri, 10 Dec 2010 17:50:26 +0000 (17:50 +0000)
  patch by: gyp at balabit dot hu

ext/pdo_pgsql/pgsql_statement.c

index b0829452f66c29f383d1eb2dd2c86c0a56eae650..6380acbfc14a3135adef857b982e9e1ebdbe0c2a 100644 (file)
@@ -184,7 +184,7 @@ stmt_retry:
                                         * chance to DEALLOCATE the prepared statements it has created. so, if we hit a 42P05 we 
                                         * deallocate it and retry ONCE (thies 2005.12.15)
                                         */
-                                       if (!strcmp(sqlstate, "42P05")) {
+                                       if (sqlstate && !strcmp(sqlstate, "42P05")) {
                                                char buf[100]; /* stmt_name == "pdo_crsr_%08x" */
                                                PGresult *res;
                                                snprintf(buf, sizeof(buf), "DEALLOCATE %s", S->stmt_name);