1 diff -up php-5.2.17/ext/zip/zip_stream.c.bug-49072 php-5.2.17/ext/zip/zip_stream.c
2 --- php-5.2.17/ext/zip/zip_stream.c.bug-49072 2011-08-28 14:06:52.000000000 +0700
3 +++ php-5.2.17/ext/zip/zip_stream.c 2011-08-28 14:09:41.000000000 +0700
4 @@ -34,7 +34,7 @@ static size_t php_zip_ops_read(php_strea
5 STREAM_DATA_FROM_STREAM();
7 if (self->za && self->zf) {
8 - n = (size_t)zip_fread(self->zf, buf, (int)count);
9 + n = zip_fread(self->zf, buf, count);
12 zip_file_error_get(self->zf, &ze, &se);
13 @@ -42,13 +42,13 @@ static size_t php_zip_ops_read(php_strea
14 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zip stream error: %s", zip_file_strerror(self->zf));
17 - if (n == 0 || n < count) {
18 + if (n == 0 || n < (ssize_t)count) {
25 + return (n < 1 ? 0 : (size_t)n);