iliaa Mon Jul 5 17:31:35 2004 EDT
Modified files:
/php-src/ext/soap php_sdl.c
Log:
Eliminate alloca() calls where they can be affected by the users.
http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.69&r2=1.70&ty=u
Index: php-src/ext/soap/php_sdl.c
diff -u php-src/ext/soap/php_sdl.c:1.69 php-src/ext/soap/php_sdl.c:1.70
--- php-src/ext/soap/php_sdl.c:1.69 Wed May 5 06:31:26 2004
+++ php-src/ext/soap/php_sdl.c Mon Jul 5 17:31:35 2004
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_sdl.c,v 1.69 2004/05/05 10:31:26 dmitry Exp $ */
+/* $Id: php_sdl.c,v 1.70 2004/07/05 21:31:35 iliaa Exp $ */
#include "php_soap.h"
#include "libxml/uri.h"
@@ -52,7 +52,7 @@
int ns_len = strlen(nsptr->href);
int type_len = strlen(cptype);
int len = ns_len + type_len + 1;
- char *nscat = do_alloca(len + 1);
+ char *nscat = emalloc(len + 1);
memcpy(nscat, nsptr->href, ns_len);
nscat[ns_len] = ':';
@@ -63,7 +63,7 @@
if (enc == NULL) {
enc = get_encoder_ex(sdl, type, type_len);
}
- free_alloca(nscat);
+ efree(nscat);
} else {
enc = get_encoder_ex(sdl, type, strlen(type));
}
@@ -88,7 +88,7 @@
int ns_len = strlen(nsptr->href);
int type_len = strlen(cptype);
int len = ns_len + type_len + 1;
- char *nscat = do_alloca(len + 1);
+ char *nscat = emalloc(len + 1);
memcpy(nscat, nsptr->href, ns_len);
nscat[ns_len] = ':';
@@ -100,7 +100,7 @@
} else if (zend_hash_find(sdl->elements, (char*)type, type_len
+ 1, (void **)&sdl_type) == SUCCESS) {
ret = *sdl_type;
}
- free_alloca(nscat);
+ efree(nscat);
} else {
if (zend_hash_find(sdl->elements, (char*)type, strlen(type) +
1, (void **)&sdl_type) == SUCCESS) {
ret = *sdl_type;
@@ -121,7 +121,7 @@
int type_len = strlen(type);
int len = ns_len + type_len + 1;
- nscat = do_alloca(len + 1);
+ nscat = emalloc(len + 1);
memcpy(nscat, ns, ns_len);
nscat[ns_len] = ':';
memcpy(nscat+ns_len+1, type, type_len);
@@ -129,7 +129,7 @@
enc = get_encoder_ex(sdl, nscat, len);
- free_alloca(nscat);
+ efree(nscat);
return enc;
}
@@ -2190,7 +2190,7 @@
PHP_MD5Update(&context, fn, strlen(fn));
PHP_MD5Final(digest, &context);
make_digest(md5str, digest);
- key = do_alloca(len+sizeof("/wsdl-")-1+sizeof(md5str));
+ key = emalloc(len+sizeof("/wsdl-")-1+sizeof(md5str));
memcpy(key,SOAP_GLOBAL(cache_dir),len);
memcpy(key+len,"/wsdl-",sizeof("/wsdl-")-1);
memcpy(key+len+sizeof("/wsdl-")-1,md5str,sizeof(md5str));
@@ -2201,7 +2201,7 @@
add_sdl_to_cache(key, fn, t, sdl);
}
}
- free_alloca(key);
+ efree(key);
}
} else {
sdl = load_wsdl(uri);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php