From c4fc15408937f7363fd8099dbb24269ea1b49af4 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Thu, 2 Jan 2003 19:50:37 +0000 Subject: MFH --- ext/standard/html.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/standard/html.c b/ext/standard/html.c index fe2cf57a81..29f544435a 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -674,6 +674,9 @@ PHPAPI char *php_unescape_html_entities(unsigned char *old, int oldlen, int *new ret = estrdup(old); retlen = oldlen; + if (!retlen) { + goto empty_source; + } if (all) { /* look for a match in the maps for this charset */ @@ -722,7 +725,7 @@ PHPAPI char *php_unescape_html_entities(unsigned char *old, int oldlen, int *new efree(ret); ret = replaced; } - +empty_source: *newlen = retlen; return ret; } -- cgit v1.2.1