From 5d286e21eab0f721892f7bf44439232d5cd0870e Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Thu, 16 May 2002 14:41:15 +0000 Subject: [PATCH] Fix for #17271 @ Fix crash bug in stripslashes() when working in sybase mode (Rasmus) --- ext/standard/string.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/standard/string.c b/ext/standard/string.c index 017a26a0ee..912e43dc93 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -420,6 +420,7 @@ PHP_FUNCTION(nl_langinfo) } } #endif +/* }}} */ #ifdef HAVE_STRCOLL /* {{{ proto int strcoll(string str1, string str2) @@ -2130,7 +2131,7 @@ PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC) t = str; if (PG(magic_quotes_sybase)) { - while (l >= 0) { + while (l > 0) { if(*t=='\'') { if((l>0) && (t[1]=='\'')) { t++; @@ -2141,6 +2142,7 @@ PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC) } *s++ = *t++; l--; + php_printf("%d\n",l); } *s = '\0'; -- 2.50.1