pollita Thu Apr 3 20:33:58 2003 EDT Modified files: /php4/main/streams streams.c Log: Prevent php_stream_get_record from grabbing more than maxlen characters Index: php4/main/streams/streams.c diff -u php4/main/streams/streams.c:1.16 php4/main/streams/streams.c:1.17 --- php4/main/streams/streams.c:1.16 Mon Mar 31 18:22:10 2003 +++ php4/main/streams/streams.c Thu Apr 3 20:33:58 2003 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streams.c,v 1.16 2003/03/31 23:22:10 moriyoshi Exp $ */ +/* $Id: streams.c,v 1.17 2003/04/04 01:33:58 pollita Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -801,6 +801,10 @@ } else { toread = e - (char *) stream->readbuf; } + } + + if (toread > maxlen && maxlen > 0) { + toread = maxlen; } buf = emalloc(toread + 1);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php