iliaa Wed Aug 27 20:31:38 2003 EDT Modified files: /php-src/ext/pgsql pgsql.c Log: Fixed bug #25109 (Possible crash when fetching field name) Index: php-src/ext/pgsql/pgsql.c diff -u php-src/ext/pgsql/pgsql.c:1.290 php-src/ext/pgsql/pgsql.c:1.291 --- php-src/ext/pgsql/pgsql.c:1.290 Tue Aug 26 20:04:19 2003 +++ php-src/ext/pgsql/pgsql.c Wed Aug 27 20:31:36 2003 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pgsql.c,v 1.290 2003/08/27 00:04:19 iliaa Exp $ */ +/* $Id: pgsql.c,v 1.291 2003/08/28 00:31:36 iliaa Exp $ */ #include <stdlib.h> @@ -1203,7 +1203,10 @@ char *tmp_oid, *end_ptr, *tmp_name; list_entry new_oid_entry; - if ((result = PQexec(pgsql,"select oid,typname from pg_type")) == NULL) { + if ((result = PQexec(pgsql,"select oid,typname from pg_type")) == NULL || PQresultStatus(result) != PGRES_TUPLES_OK) { + if (result) { + PQclear(result); + } smart_str_free(&str); return empty_string; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php