helly Sun Jun 22 11:53:51 2003 EDT
Modified files:
/php4/ext/dba dba_inifile.c
Log:
Fix possible SEGV
Index: php4/ext/dba/dba_inifile.c
diff -u php4/ext/dba/dba_inifile.c:1.2 php4/ext/dba/dba_inifile.c:1.3
--- php4/ext/dba/dba_inifile.c:1.2 Tue Jun 10 16:03:26 2003
+++ php4/ext/dba/dba_inifile.c Sun Jun 22 11:53:50 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dba_inifile.c,v 1.2 2003/06/10 20:03:26 imajes Exp $ */
+/* $Id: dba_inifile.c,v 1.3 2003/06/22 15:53:50 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