cvs: Zend(PHP_4_3) / zend_constants.c
| From: | Ilia Alshanetsky | Date: | Thu, 01 Jul 2004 16:28:34 +0000 |
| Subject: | cvs: Zend(PHP_4_3) / zend_constants.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-2717@lists.php.net to get a copy of this message | ||
iliaa Thu Jul 1 12:28:34 2004 EDT
Modified files: (Branch: PHP_4_3)
/Zend zend_constants.c
Log:
MFHZE2: Do not use alloca() where it can be easily abused by the users.
http://cvs.php.net/diff.php/Zend/zend_constants.c?r1=1.42.2.5&r2=1.42.2.6&ty=u
Index: Zend/zend_constants.c
diff -u Zend/zend_constants.c:1.42.2.5 Zend/zend_constants.c:1.42.2.6
--- Zend/zend_constants.c:1.42.2.5 Wed May 26 17:02:12 2004
+++ Zend/zend_constants.c Thu Jul 1 12:28:33 2004
@@ -220,8 +220,7 @@
int retval = 1;
if (zend_hash_find(EG(zend_constants), name, name_len+1, (void **) &c) == FAILURE) {
- lookup_name = do_alloca(name_len+1);
- memcpy(lookup_name, name, name_len+1);
+ lookup_name = estrndup(name, name_len);
zend_str_tolower(lookup_name, name_len);
if (zend_hash_find(EG(zend_constants), lookup_name, name_len+1, (void **) &c)==SUCCESS) {
@@ -231,7 +230,7 @@
} else {
retval=0;
}
- free_alloca(lookup_name);
+ efree(lookup_name);
}
if (retval) {