cvs: php4 /ext/standard file.c

From: Date: Sun, 18 Aug 2002 06:55:33 +0000
Subject: cvs: php4 /ext/standard file.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13450@lists.php.net to get a copy of this message
iliaa Sun Aug 18 02:55:33 2002 EDT Modified files: /php4/ext/standard file.c Log: Fixed a segmentation fault that would occur if an entry contained a non-terminated enclosure. Bug #12556 Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.242 php4/ext/standard/file.c:1.243 --- php4/ext/standard/file.c:1.242 Tue Aug 13 01:08:47 2002 +++ php4/ext/standard/file.c Sun Aug 18 02:55:32 2002 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.242 2002/08/13 05:08:47 rasmus Exp $ */ +/* $Id: file.c,v 1.243 2002/08/18 06:55:32 iliaa Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -1991,8 +1991,14 @@ while(isspace((int) *bptr) && (*bptr!=delimiter)) bptr++; /* 2. Read field, leaving bptr pointing at start of next field */ if (enclosure && *bptr == enclosure) { + bptr++; /* move on to first character in field */ + + /* Check if there is an end to the enclosure */ + if( !strchr(bptr, enclosure) ) { + continue; + } + /* 2A. handle enclosure delimited field */ - bptr++; /* move on to first character in field */ while (*bptr) { if (*bptr == enclosure) { /* handle the enclosure */

« previous php.cvs (#13450) next »