From: Marcus Boerger Date: Wed, 10 Jan 2007 20:12:14 +0000 (+0000) Subject: - Fix mem access X-Git-Tag: RELEASE_1_0_0RC1~317 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e5762b7241dacfac60389a15a6f44ab4db213dc8;p=php - Fix mem access --- diff --git a/ext/standard/file.c b/ext/standard/file.c index 9ea068d4ca..1928edc0d9 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -2425,6 +2425,7 @@ post_enc: state = PHP_FGETCSV_READY; field_start = field_end = NULL; p += delimiter_len; + if (p >= e) break; goto ready_state; } @@ -2446,6 +2447,7 @@ post_enc: state = PHP_FGETCSV_READY; field_start = field_end = NULL; p += delimiter_len; + if (p >= e) break; goto ready_state; } @@ -2546,6 +2548,7 @@ with_enc: memmove(p, p + enclosure_len, (e - p) - enclosure_len); e -= enclosure_len; p += enclosure_len; + if (p >= e) break; goto with_enc; } else { /* Genuine end enclosure, switch state */ @@ -2561,6 +2564,7 @@ with_enc: p += escape_len + 1; /* Reprocess for ending enclosures */ + if (p >= e) break; goto with_enc; }