]> granicus.if.org Git - php/commitdiff
Fixed bug #25316 (Possible infinite loop inside _php_stream_write()).
authorIlia Alshanetsky <iliaa@php.net>
Thu, 11 Sep 2003 05:07:26 +0000 (05:07 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 11 Sep 2003 05:07:26 +0000 (05:07 +0000)
main/streams/streams.c

index 90e77b710eca60cde60b078c346af60dc291200c..55919284700cc4b553658453a0e7dfc2c412cb5d 100755 (executable)
@@ -867,7 +867,8 @@ static size_t _php_stream_write_buffer(php_stream *stream, const char *buf, size
 
                justwrote = stream->ops->write(stream, buf, towrite TSRMLS_CC);
 
-               if (justwrote > 0) {
+               /* convert justwrote to an integer, since normally it is unsigned */
+               if ((int)justwrote > 0) {
                        buf += justwrote;
                        count -= justwrote;
                        didwrite += justwrote;