From: Stanislav Malyshev Date: Mon, 17 Jul 2000 10:22:30 +0000 (+0000) Subject: Fix crash in stripcslashes("") (#5628) X-Git-Tag: PRE_FILE_COMPILE_API_CHANGE~248 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b9d2e33bf6acbc90658d4f97ad9297d33f35208;p=php Fix crash in stripcslashes("") (#5628) --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 333bc1f862..5e4fcdfe92 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1617,7 +1617,10 @@ PHPAPI void php_stripcslashes(char *str, int *len) *target++=*source; } } - *target='\0'; + + if(nlen != 0) { + *target='\0'; + } *len = nlen; }