cvs: php4 /ext/standard string.c
| From: | Gavin Sherry | Date: | Wed, 22 Aug 2001 05:47:11 +0000 |
| Subject: | cvs: php4 /ext/standard string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-7012@lists.php.net to get a copy of this message | ||
swm Wed Aug 22 01:47:11 2001 EDT
Modified files:
/php4/ext/standard string.c
Log:
Fixed buffer overflow issue.
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.226 php4/ext/standard/string.c:1.227
--- php4/ext/standard/string.c:1.226 Tue Aug 21 22:03:14 2001
+++ php4/ext/standard/string.c Wed Aug 22 01:47:11 2001
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.226 2001/08/22 02:03:14 swm Exp $ */
+/* $Id: string.c,v 1.227 2001/08/22 05:47:11 swm Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -3289,16 +3289,23 @@
break;
case '?':
- if (state==1 && *(p-1)=='<' && *(p+1) != 'x'
- && *(p+2) != 'm' && *(p+3) != 'l') {
+ if (state==1 && *(p-1)=='<') {
br=0;
state=2;
break;
}
- /* else, it is xml, since state == 1, lets just fall through
- * to '>'
- */
+
+ case 'l':
+
+ /* swm: If we encounter '<?xml' then we shouldn't be in
+ * state == 2 (PHP). Switch back to HTML.
+ */
+
+ if(state == 2 && *(p-1) == 'm' && *(p-2) == 'x') {
+ state = 1;
+ break;
+ }
/* fall-through */
default: