]> granicus.if.org Git - php/commitdiff
Make sure p is not pointing to the start of the buffer
authorIlia Alshanetsky <iliaa@php.net>
Tue, 13 Feb 2007 23:55:20 +0000 (23:55 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 13 Feb 2007 23:55:20 +0000 (23:55 +0000)
ext/standard/string.c

index 335cb64d5cba2a8f80d0a85a4f5373f0d665aa32..355792778b5dbba46598d2d4784ab365264c2bc6 100644 (file)
@@ -4263,7 +4263,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow,
                                        tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp);
                                        *(tp++) = c;
                                }
-                               if (*(p-1) != '\\') {
+                               if (p != buf && *(p-1) != '\\') {
                                        in_q = !in_q;
                                }
                                break;