cvs: php4 /ext/standard string.c

From: Date: Wed, 13 Dec 2000 10:22:36 +0000
Subject: cvs: php4 /ext/standard string.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-3111@lists.php.net to get a copy of this message
stas Wed Dec 13 02:22:36 2000 EDT Modified files: /php4/ext/standard string.c Log: Fix crash when first argument to strtr is empty Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.170 php4/ext/standard/string.c:1.171 --- php4/ext/standard/string.c:1.170 Mon Dec 11 08:27:48 2000 +++ php4/ext/standard/string.c Wed Dec 13 02:22:36 2000 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.170 2000/12/11 16:27:48 zeev Exp $ */ +/* $Id: string.c,v 1.171 2000/12/13 10:22:36 stas Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -1572,6 +1572,11 @@ } convert_to_string_ex(str); + + /* shortcut for empty string */ + if(Z_STRLEN_PP(str) == 0) { + RETURN_EMPTY_STRING(); + } if (ac == 2) { php_strtr_array(return_value,(*str)->value.str.val,(*str)->value.str.len,HASH_OF(*from));

« previous php.cvs (#3111) next »