]> granicus.if.org Git - php/commitdiff
Fix crashes in parse_parameters calls
authorZeev Suraski <zeev@php.net>
Mon, 13 Aug 2001 19:31:18 +0000 (19:31 +0000)
committerZeev Suraski <zeev@php.net>
Mon, 13 Aug 2001 19:31:18 +0000 (19:31 +0000)
HEADS UP:  Make sure you supply TSRMLS_CC for this function!
I'll try to think of a way that'd allow us to find this issue using
the compiler.

ext/snmp/snmp.c
ext/standard/info.c
ext/zip/zip.c

index 810642bb1d5f3e5d3afbed1cf2c0eb51c6c28e77..7de02c19303461f5566359d1800843eda024da16 100644 (file)
@@ -417,8 +417,9 @@ PHP_FUNCTION(snmp_set_quick_print)
        int argc = ZEND_NUM_ARGS();
        long a1;
 
-       if (zend_parse_parameters(argc, "l", &a1) == FAILURE)
+       if (zend_parse_parameters(argc TSRMLS_CC, "l", &a1) == FAILURE) {
                return;
+       }
 
        snmp_set_quick_print((int)a1);
 }
index 0fa5414a1d5281e9c107da1404309694490f2077..0227db10eb761971458e1b3edbddc16932d8923d 100644 (file)
@@ -458,8 +458,9 @@ PHP_FUNCTION(phpinfo)
        int argc = ZEND_NUM_ARGS();
        long flag;
 
-       if (zend_parse_parameters(argc, "|l", &flag) == FAILURE)
+       if (zend_parse_parameters(argc TSRMLS_CC, "|l", &flag) == FAILURE) {
                return;
+       }
 
        if(!argc) {
                flag = 0xFFFFFFFF;
@@ -491,8 +492,9 @@ PHP_FUNCTION(phpcredits)
        int argc = ZEND_NUM_ARGS();
        long flag;
 
-       if (zend_parse_parameters(argc, "|l", &flag) == FAILURE)
+       if (zend_parse_parameters(argc TSRMLS_CC, "|l", &flag) == FAILURE) {
                return;
+       }
 
        if(!argc) {
                flag = 0xFFFFFFFF;
index dcd0046540107c0e9f7c2ac9e6150ff3afc35189..dc40a7f422fc7c4954d7bc05683ea33bacbf6abc 100644 (file)
@@ -122,8 +122,9 @@ PHP_FUNCTION(zip_open)
     ZZIP_DIR *archive_p = NULL;
     int       filename_len;
 
-    if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE)
-    return;
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+           return;
+       }
 
     archive_p = zzip_opendir(filename);
     if (archive_p == NULL) {
@@ -144,8 +145,9 @@ PHP_FUNCTION(zip_read)
     php_zzip_dirent  *entry = NULL;
     int               ret;
 
-    if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zzip_dp) == FAILURE)
-    return;
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zzip_dp) == FAILURE) {
+           return;
+       }
 
     ZEND_FETCH_RESOURCE(archive_p, ZZIP_DIR *, zzip_dp, -1, le_zip_dir_name, le_zip_dir);
 
@@ -168,8 +170,9 @@ PHP_FUNCTION(zip_close)
     zval     **zzip_dp;
     ZZIP_DIR  *archive_p = NULL;
 
-    if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zzip_dp) == FAILURE)
-    return;
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zzip_dp) == FAILURE) {
+           return;
+       }
 
     ZEND_FETCH_RESOURCE(archive_p, ZZIP_DIR *, zzip_dp, -1, le_zip_dir_name, le_zip_dir);
 
@@ -184,8 +187,9 @@ static void php_zzip_get_entry(INTERNAL_FUNCTION_PARAMETERS, int opt)
     zval            **zzip_ent;
     php_zzip_dirent  *entry = NULL;
 
-    if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zzip_ent) == FAILURE)
-    return;
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zzip_ent) == FAILURE) {
+           return;
+       }
 
     ZEND_FETCH_RESOURCE(entry, php_zzip_dirent *, zzip_ent, -1, le_zip_entry_name, le_zip_entry);
 
@@ -248,8 +252,9 @@ PHP_FUNCTION(zip_entry_open)
     php_zzip_dirent  *entry = NULL;
     int               mode;
 
-    if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|i", &zzip_dp, &zzip_ent, &mode) == FAILURE)
-    return;
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|i", &zzip_dp, &zzip_ent, &mode) == FAILURE) {
+               return;
+       }
 
     ZEND_FETCH_RESOURCE(archive_p, ZZIP_DIR *,        zzip_dp,  -1, le_zip_dir_name,   le_zip_dir);
     ZEND_FETCH_RESOURCE(entry,     php_zzip_dirent *, zzip_ent, -1, le_zip_entry_name, le_zip_entry);
@@ -273,8 +278,9 @@ PHP_FUNCTION(zip_entry_read)
     int               len   = 1024;
     int               ret   = 0;
 
-    if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|i", &zzip_ent, &len) == FAILURE)
-    return;
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|i", &zzip_ent, &len) == FAILURE) {
+           return;
+       }
     
     ZEND_FETCH_RESOURCE(entry, php_zzip_dirent *, zzip_ent, -1, le_zip_entry_name, le_zip_entry);
 
@@ -294,8 +300,9 @@ PHP_FUNCTION(zip_entry_close)
     zval            **zzip_ent;
     php_zzip_dirent  *entry = NULL;
 
-    if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zzip_ent) == FAILURE)
-    return;
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zzip_ent) == FAILURE) {
+               return;
+       }
 
     ZEND_FETCH_RESOURCE(entry, php_zzip_dirent *, zzip_ent, -1, le_zip_entry_name, le_zip_entry);