cvs: php4 /ext/snmp snmp.c /ext/standard info.c /ext/zip zip.c
| From: | Zeev Suraski | Date: | Mon, 13 Aug 2001 19:31:18 +0000 |
| Subject: | cvs: php4 /ext/snmp snmp.c /ext/standard info.c /ext/zip zip.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6783@lists.php.net to get a copy of this message | ||
zeev Mon Aug 13 15:31:18 2001 EDT
Modified files:
/php4/ext/snmp snmp.c
/php4/ext/standard info.c
/php4/ext/zip zip.c
Log:
Fix crashes in parse_parameters calls
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.
Index: php4/ext/snmp/snmp.c
diff -u php4/ext/snmp/snmp.c:1.47 php4/ext/snmp/snmp.c:1.48
--- php4/ext/snmp/snmp.c:1.47 Mon Aug 13 03:55:37 2001
+++ php4/ext/snmp/snmp.c Mon Aug 13 15:31:15 2001
@@ -17,7 +17,7 @@
| Steven Lawrance <slawrance@technologist.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: snmp.c,v 1.47 2001/08/13 07:55:37 rasmus Exp $ */
+/* $Id: snmp.c,v 1.48 2001/08/13 19:31:15 zeev Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -417,8 +417,9 @@
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: php4/ext/standard/info.c
diff -u php4/ext/standard/info.c:1.152 php4/ext/standard/info.c:1.153
--- php4/ext/standard/info.c:1.152 Mon Aug 13 03:55:38 2001
+++ php4/ext/standard/info.c Mon Aug 13 15:31:16 2001
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: info.c,v 1.152 2001/08/13 07:55:38 rasmus Exp $ */
+/* $Id: info.c,v 1.153 2001/08/13 19:31:16 zeev Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -458,8 +458,9 @@
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 @@
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: php4/ext/zip/zip.c
diff -u php4/ext/zip/zip.c:1.12 php4/ext/zip/zip.c:1.13
--- php4/ext/zip/zip.c:1.12 Mon Aug 13 01:51:06 2001
+++ php4/ext/zip/zip.c Mon Aug 13 15:31:18 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zip.c,v 1.12 2001/08/13 05:51:06 sterling Exp $ */
+/* $Id: zip.c,v 1.13 2001/08/13 19:31:18 zeev Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -122,8 +122,9 @@
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_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 @@
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 @@
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_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 @@
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 @@
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);