Re: cvs: php4(PHP_4_3) /ext/standard file.c

From: Date: Wed, 14 May 2003 07:04:48 +0000
Subject: Re: cvs: php4(PHP_4_3) /ext/standard file.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-20891@lists.php.net to get a copy of this message
Sascha, will you apply the fix to the HEAD too? Regards, Andrey ----- Original Message ----- From: "Sascha Schumann" <sascha@schumann.cx> To: <php-cvs@lists.php.net> Sent: Wednesday, May 14, 2003 4:08 AM Subject: [PHP-CVS] cvs: php4(PHP_4_3) /ext/standard file.c > sas Tue May 13 21:08:48 2003 EDT > > Modified files: (Branch: PHP_4_3) > /php4/ext/standard file.c > Log: > Fix file_get_contents segfault on empty file > > > Index: php4/ext/standard/file.c > diff -u php4/ext/standard/file.c:1.279.2.19 php4/ext/standard/file.c:1.279.2.20 > --- php4/ext/standard/file.c:1.279.2.19 Mon May 12 20:18:27 2003 > +++ php4/ext/standard/file.c Tue May 13 21:08:47 2003 > @@ -21,7 +21,7 @@ > +----------------------------------------------------------------------+ > */ > > -/* $Id: file.c,v 1.279.2.19 2003/05/13 00:18:27 wez Exp $ */ > +/* $Id: file.c,v 1.279.2.20 2003/05/14 01:08:47 sas Exp $ */ > > /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ > > @@ -434,14 +434,15 @@ > } > > /* uses mmap if possible */ > - if ((len = php_stream_copy_to_mem(stream, &contents, PHP_STREAM_COPY_ALL, 0)) >= 0) { > - > + if ((len = php_stream_copy_to_mem(stream, &contents, PHP_STREAM_COPY_ALL, 0)) > 0) { > if (PG(magic_quotes_runtime)) { > contents = php_addslashes(contents, len, &newlen, 1 TSRMLS_CC); /* 1 = free source string */ > len = newlen; > } > > RETVAL_STRINGL(contents, len, 0); > + } else if (len == 0) { > + RETVAL_EMPTY_STRING(); > } else { > RETVAL_FALSE; > } > > > > -- > PHP CVS Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.cvs (#20891) next »