diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-08-12 00:58:52 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-08-12 00:58:52 +0000 |
commit | 93bcd55eafbcf2a49e8963c3475d5a7b1fbc8c53 (patch) | |
tree | 981e9591cd93532e591400b35b595735a6eee0b7 /ext/xml/xml.c | |
parent | 3652ab6032819e4854ae607fe8084cd129791983 (diff) | |
download | php-git-93bcd55eafbcf2a49e8963c3475d5a7b1fbc8c53.tar.gz |
emalloc -> safe_emalloc
Diffstat (limited to 'ext/xml/xml.c')
-rw-r--r-- | ext/xml/xml.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/xml/xml.c b/ext/xml/xml.c index ef6f762ea4..210d25648d 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -408,7 +408,7 @@ static zval *xml_call_handler(xml_parser *parser, zval *handler, zend_function * int result; zend_fcall_info fci; - args = emalloc(sizeof(zval **) * argc); + args = safe_emalloc(sizeof(zval **), argc, 0); for (i = 0; i < argc; i++) { args[i] = &argv[i]; } @@ -525,7 +525,7 @@ static XML_Char *xml_utf8_encode(const char *s, int len, int *newlen, const XML_ } /* This is the theoretical max (will never get beyond len * 2 as long * as we are converting from single-byte characters, though) */ - newbuf = emalloc(len * 4 + 1); + newbuf = safe_emalloc(len, 4, 1); while (pos > 0) { c = encoder ? encoder((unsigned char)(*s)) : (unsigned short)(*s); if (c < 0x80) { @@ -1368,7 +1368,7 @@ PHP_FUNCTION(xml_parse_into_struct) if (info) parser->info = *info; parser->level = 0; - parser->ltags = emalloc(XML_MAXLEVEL * sizeof(char *)); + parser->ltags = safe_emalloc(XML_MAXLEVEL, sizeof(char *), 0); XML_SetDefaultHandler(parser->parser, _xml_defaultHandler); XML_SetElementHandler(parser->parser, _xml_startElementHandler, _xml_endElementHandler); |