Skip to content

Commit 3c8bc99

Browse files
committed
- Fixed bug #53517 (segfault in pgsql_stmt_execute() when postgres is down)
patch by: gyp at balabit dot hu
1 parent 6f3cad9 commit 3c8bc99

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ext/pdo_pgsql/pgsql_statement.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
184184
* chance to DEALLOCATE the prepared statements it has created. so, if we hit a 42P05 we
185185
* deallocate it and retry ONCE (thies 2005.12.15)
186186
*/
187-
if (!strcmp(sqlstate, "42P05")) {
187+
if (sqlstate && !strcmp(sqlstate, "42P05")) {
188188
char buf[100]; /* stmt_name == "pdo_crsr_%08x" */
189189
PGresult *res;
190190
snprintf(buf, sizeof(buf), "DEALLOCATE %s", S->stmt_name);

0 commit comments

Comments
 (0)