diff options
author | Rasmus Lerdorf <rasmus@php.net> | 2002-05-16 14:41:15 +0000 |
---|---|---|
committer | Rasmus Lerdorf <rasmus@php.net> | 2002-05-16 14:41:15 +0000 |
commit | 5d286e21eab0f721892f7bf44439232d5cd0870e (patch) | |
tree | 3bfe8909afdd303cd70c77d530f5cad32cafb4a6 | |
parent | 0b70f9e88468e2b9a076cb8cf33e023e7d4f62ec (diff) | |
download | php-git-5d286e21eab0f721892f7bf44439232d5cd0870e.tar.gz |
Fix for #17271
@ Fix crash bug in stripslashes() when working in sybase mode (Rasmus)
-rw-r--r-- | ext/standard/string.c | 4 |
1 files changed, 3 insertions, 1 deletions
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'; |