From: Sascha Schumann Date: Thu, 19 Oct 2000 17:40:56 +0000 (+0000) Subject: Hack for #7262, not fixed yet X-Git-Tag: php-4.0.4RC3~615 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d9acd8337e92df4a5e3102ab77f4d480c4af212;p=php Hack for #7262, not fixed yet --- diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index 5e0adb9078..c89420e71a 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.5 on Tue Oct 17 16:16:42 2000 */ +/* Generated by re2c 0.5 on Thu Oct 19 19:46:51 2000 */ #line 1 "/home/sas/src/php4/ext/standard/url_scanner_ex.re" /* +----------------------------------------------------------------------+ @@ -638,7 +638,10 @@ stop: scdebug(("stopped in state %d at pos %d (%d:%c)\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR)); rest = YYLIMIT - start; - + + /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */ + if (rest < 0) rest = 0; + if (rest) memmove(ctx->buf.c, start, rest); ctx->buf.len = rest; } diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index 228917c548..b4a108d6d2 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -281,7 +281,10 @@ stop: scdebug(("stopped in state %d at pos %d (%d:%c)\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR)); rest = YYLIMIT - start; - + + /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */ + if (rest < 0) rest = 0; + if (rest) memmove(ctx->buf.c, start, rest); ctx->buf.len = rest; }