]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #25109 (Possible crash when fetching field names in pgsql)
authorIlia Alshanetsky <iliaa@php.net>
Thu, 28 Aug 2003 00:33:48 +0000 (00:33 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 28 Aug 2003 00:33:48 +0000 (00:33 +0000)
NEWS
ext/pgsql/pgsql.c

diff --git a/NEWS b/NEWS
index 540fcb64dcc7b5b3fb22f19d8391db74e640d6c2..803eed57cc92b266b4269465206f5f7b78a3c839 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,8 +3,9 @@ PHP 4                                                                      NEWS
 ?? ??? 2003, Version 4.3.4
 - Fixed disk_total_space() and disk_free_space() under FreeBSD. (Jon Parise)
 - Fixed crash bug when non-existing save/serializer handler was used. (Jani)
-- Fixed bug #25166 (WDDX serializer handler missing in win32). (Jani)
 - Fixed bug #25239 (ftp_fopen_wrapper not RFC compliant). (Sara)
+- Fixed bug #25166 (WDDX serializer handler missing in win32). (Jani)
+- Fixed bug #25109 (Possible crash when fetching field names in pgsql). (Ilia)
 
 25 Aug 2003, Version 4.3.3
 - Upgraded the bundled Expat library to version 1.95.6. (Jani)
index 0f43f35dec2c4b8a78b314ce5f85d00ff1737ee6..b2ab411f6087b9f4f20c4abad909cf8654bfe3c0 100644 (file)
@@ -1093,7 +1093,10 @@ static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list TSRMLS_DC)
                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;
                }