Skip to content

Commit

Permalink
Fix for #17271
Browse files Browse the repository at this point in the history
@ Fix crash bug in stripslashes() when working in sybase mode (Rasmus)
  • Loading branch information
rlerdorf committed May 16, 2002
1 parent 0b70f9e commit 5d286e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/standard/string.c
Expand Up @@ -420,6 +420,7 @@ PHP_FUNCTION(nl_langinfo)
}
}
#endif
/* }}} */

#ifdef HAVE_STRCOLL
/* {{{ proto int strcoll(string str1, string str2)
Expand Down Expand Up @@ -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++;
Expand All @@ -2141,6 +2142,7 @@ PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC)
}
*s++ = *t++;
l--;
php_printf("%d\n",l);
}
*s = '\0';

Expand Down

0 comments on commit 5d286e2

Please sign in to comment.