]> granicus.if.org Git - php/commitdiff
fix segfault & buffer overrun when there is no PDO drivers plugged in
authorAntony Dovgal <tony2001@php.net>
Tue, 29 Mar 2005 17:23:36 +0000 (17:23 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 29 Mar 2005 17:23:36 +0000 (17:23 +0000)
(patch by su1d@phpclub.net)

ext/pdo/pdo.c

index 2c984039eb2ceb400991b21df86cbbfaf93bcf50..fc3216c9b6d2c7697fe6beeb2bce5777781c5a23 100755 (executable)
@@ -410,9 +410,11 @@ PHP_MINFO_FUNCTION(pdo)
                ldrivers = drivers;
        }
        
-       php_info_print_table_row(2, "PDO drivers", drivers+2);
-       
-       efree(drivers);
+       php_info_print_table_row(2, "PDO drivers", drivers ? drivers+2 : "");
+
+       if (drivers) {
+               efree(drivers);
+       }
 
        php_info_print_table_end();