summaryrefslogtreecommitdiff
path: root/ext/dba
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-06-22 15:53:50 +0000
committerMarcus Boerger <helly@php.net>2003-06-22 15:53:50 +0000
commit1cdc2d48b65377072d08417d086791f453fc9d09 (patch)
tree3084f20ed5d0f515f7ee415630c47012dda08cfa /ext/dba
parent51dbd3b39efa06c028cef187fecc67758d0d6407 (diff)
downloadphp-git-1cdc2d48b65377072d08417d086791f453fc9d09.tar.gz
Fix possible SEGV
Diffstat (limited to 'ext/dba')
-rw-r--r--ext/dba/dba_inifile.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c
index 6d1f7ee557..dae9a081c5 100644
--- a/ext/dba/dba_inifile.c
+++ b/ext/dba/dba_inifile.c
@@ -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_EXISTS_FUNC(inifile)
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);