helly Sun Jun 22 11:55:31 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/ext/dba dba_inifile.c
Log:
MFH: Fix possible SEGV
Index: php4/ext/dba/dba_inifile.c
diff -u php4/ext/dba/dba_inifile.c:1.1.2.1 php4/ext/dba/dba_inifile.c:1.1.2.2
--- php4/ext/dba/dba_inifile.c:1.1.2.1 Thu May 29 10:16:25 2003
+++ php4/ext/dba/dba_inifile.c Sun Jun 22 11:55:31 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dba_inifile.c,v 1.1.2.1 2003/05/29 14:16:25 helly Exp $ */
+/* $Id: dba_inifile.c,v 1.1.2.2 2003/06/22 15:55:31 helly Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -40,7 +40,12 @@
inifile *dba = info->dbf
#define INIFILE_GKEY \
- key_type ini_key = inifile_key_split((char*)key) /* keylen not needed here */
+ key_type ini_key; \
+ if (!key) { \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "No key specified"); \
+ return 0; \
+ } \
+ ini_key = inifile_key_split((char*)key) /* keylen not needed here */
#define INIFILE_DONE \
inifile_key_free(&ini_key)
@@ -119,9 +124,12 @@
DBA_DELETE_FUNC(inifile)
{
+ int res;
+
INIFILE_DATA;
INIFILE_GKEY;
- int res = inifile_delete(dba, &ini_key TSRMLS_CC);
+
+ res = inifile_delete(dba, &ini_key TSRMLS_CC);
INIFILE_DONE;
return (res == -1 ? FAILURE : SUCCESS);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php