cvs: php-src(PHP_5_1) /ext/standard/tests/file bug35781.phpt /main/streams plain_wrapper.c streams.c

From: Date: Fri, 23 Dec 2005 14:32:11 +0000
Subject: cvs: php-src(PHP_5_1) /ext/standard/tests/file bug35781.phpt /main/streams plain_wrapper.c streams.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-36170@lists.php.net to get a copy of this message
tony2001 Fri Dec 23 14:32:11 2005 EDT Added files: (Branch: PHP_5_1) /php-src/ext/standard/tests/file bug35781.phpt Modified files: /php-src/main/streams plain_wrapper.c streams.c Log: fix #35781 (stream_filter_append() can cause segfault) http://cvs.php.net/viewcvs.cgi/php-src/main/streams/plain_wrapper.c?r1=1.52.2.2&r2=1.52.2.3&diff_format=u Index: php-src/main/streams/plain_wrapper.c diff -u php-src/main/streams/plain_wrapper.c:1.52.2.2 php-src/main/streams/plain_wrapper.c:1.52.2.3 --- php-src/main/streams/plain_wrapper.c:1.52.2.2 Thu Nov 17 14:19:40 2005 +++ php-src/main/streams/plain_wrapper.c Fri Dec 23 14:32:11 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: plain_wrapper.c,v 1.52.2.2 2005/11/17 14:19:40 tony2001 Exp $ */ +/* $Id: plain_wrapper.c,v 1.52.2.3 2005/12/23 14:32:11 tony2001 Exp $ */ #include "php.h" #include "php_globals.h" @@ -316,7 +316,7 @@ if (data->fd >= 0) { ret = read(data->fd, buf, count); - stream->eof = (ret == 0 || (ret == -1 && errno != EWOULDBLOCK)); + stream->eof = (ret == 0 || (ret == (size_t)-1 && errno != EWOULDBLOCK)); } else { #if HAVE_FLUSHIO http://cvs.php.net/viewcvs.cgi/php-src/main/streams/streams.c?r1=1.82.2.2&r2=1.82.2.3&diff_format=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.82.2.2 php-src/main/streams/streams.c:1.82.2.3 --- php-src/main/streams/streams.c:1.82.2.2 Tue Dec 20 09:47:57 2005 +++ php-src/main/streams/streams.c Fri Dec 23 14:32:11 2005 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streams.c,v 1.82.2.2 2005/12/20 09:47:57 tony2001 Exp $ */ +/* $Id: streams.c,v 1.82.2.3 2005/12/23 14:32:11 tony2001 Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -442,7 +442,7 @@ /* read a chunk into a bucket */ justread = stream->ops->read(stream, chunk_buf, stream->chunk_size TSRMLS_CC); - if (justread > 0) { + if (justread != (size_t)-1) { bucket = php_stream_bucket_new(stream, chunk_buf, justread, 0, 0 TSRMLS_CC); /* after this call, bucket is owned by the brigade */ @@ -511,7 +511,7 @@ break; } - if (justread == 0) { + if (justread == 0 || justread == (size_t)-1) { break; } } http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/file/bug35781.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/file/bug35781.phpt +++ php-src/ext/standard/tests/file/bug35781.phpt

« previous php.cvs (#36170) next »