iliaa Thu Jan 2 14:50:38 2003 EDT
Added files: (Branch: PHP_4_3)
/php4/ext/standard/tests/strings bug21338.phpt
Modified files:
/php4/ext/standard html.c
Log:
MFH
Index: php4/ext/standard/html.c
diff -u php4/ext/standard/html.c:1.63.2.5 php4/ext/standard/html.c:1.63.2.6
--- php4/ext/standard/html.c:1.63.2.5 Tue Dec 31 11:35:29 2002
+++ php4/ext/standard/html.c Thu Jan 2 14:50:37 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: html.c,v 1.63.2.5 2002/12/31 16:35:29 sebastian Exp $ */
+/* $Id: html.c,v 1.63.2.6 2003/01/02 19:50:37 iliaa Exp $ */
#include "php.h"
#if PHP_WIN32
@@ -674,6 +674,9 @@
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 @@
efree(ret);
ret = replaced;
}
-
+empty_source:
*newlen = retlen;
return ret;
}
Index: php4/ext/standard/tests/strings/bug21338.phpt
+++ php4/ext/standard/tests/strings/bug21338.phpt
--TEST--
Bug #20934 (html_entity_decode() crash when "" is passed)
--FILE--
<?php
var_dump(html_entity_decode(NULL));
var_dump(html_entity_decode(""));
?>
--EXPECT--
string(0) ""
string(0) ""
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php