diff options
author | Ondřej Surý <ondrej@sury.org> | 2015-02-17 09:39:26 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2015-02-17 09:39:26 +0100 |
commit | d1d84d4402147e7b9ae2801bb5e88d867b7e6d7f (patch) | |
tree | f38bcd0157fbb10a34c1ac915a0f5f7c1b07c922 | |
parent | 28df25dec2351b5b77c6d4f2c2e098aa93bae78e (diff) | |
download | php-d1d84d4402147e7b9ae2801bb5e88d867b7e6d7f.tar.gz |
Add patch to revert upstream commit on feof that broke Horde and others (Courtesy of Mike Gabriel) (Closes: #778374)
-rw-r--r-- | debian/patches/revert-f07b8f36ae8099e29d19fbe8806bc07b21dcd4ac.patch | 69 | ||||
-rw-r--r-- | debian/patches/series | 1 |
2 files changed, 70 insertions, 0 deletions
diff --git a/debian/patches/revert-f07b8f36ae8099e29d19fbe8806bc07b21dcd4ac.patch b/debian/patches/revert-f07b8f36ae8099e29d19fbe8806bc07b21dcd4ac.patch new file mode 100644 index 000000000..31d03c743 --- /dev/null +++ b/debian/patches/revert-f07b8f36ae8099e29d19fbe8806bc07b21dcd4ac.patch @@ -0,0 +1,69 @@ +reverted: +--- a/ext/standard/tests/file/bug68532.phpt ++++ /dev/null +@@ -1,25 +0,0 @@ +---TEST-- +-Bug #68532: convert.base64-encode omits padding bytes +---FILE-- +-<?php +-$testString = 'test'; +-$stream = fopen('php://memory','r+'); +-fwrite($stream, $testString); +-rewind($stream); +-$filter = stream_filter_append($stream, 'convert.base64-encode'); +-echo "memoryStream = " . stream_get_contents($stream).PHP_EOL; +- +- +-$fileStream = fopen(__DIR__ . '/base64test.txt','w+'); +-fwrite($fileStream , $testString); +-rewind($fileStream ); +-$filter = stream_filter_append($fileStream , 'convert.base64-encode'); +-echo "fileStream = " . stream_get_contents($fileStream ).PHP_EOL; +-?> +---CLEAN-- +-<?php +-unlink(__DIR__ . '/base64test.txt'); +-?> +---EXPECT-- +-memoryStream = dGVzdA== +-fileStream = dGVzdA== +--- a/ext/standard/tests/file/stream_rfc2397_007.phpt ++++ b/ext/standard/tests/file/stream_rfc2397_007.phpt +@@ -95,7 +95,6 @@ + bool(false) + ===GETC=== + string(1) "5" +-bool(false) + int(6) + bool(true) + ===REWIND=== +--- a/main/streams/memory.c ++++ b/main/streams/memory.c +@@ -87,19 +87,15 @@ + php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; + assert(ms != NULL); + +- if (ms->fpos == ms->fsize) { ++ if (ms->fpos + count >= ms->fsize) { ++ count = ms->fsize - ms->fpos; + stream->eof = 1; +- count = 0; +- } else { +- if (ms->fpos + count >= ms->fsize) { +- count = ms->fsize - ms->fpos; +- } +- if (count) { +- assert(ms->data!= NULL); +- assert(buf!= NULL); +- memcpy(buf, ms->data+ms->fpos, count); +- ms->fpos += count; +- } ++ } ++ if (count) { ++ assert(ms->data!= NULL); ++ assert(buf!= NULL); ++ memcpy(buf, ms->data+ms->fpos, count); ++ ms->fpos += count; + } + return count; + } diff --git a/debian/patches/series b/debian/patches/series index 3b94cb46a..2c9fba9c5 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -45,3 +45,4 @@ php-5.6.0-oldpcre.patch hack-phpdbg-to-explicitly-link-with-libedit.patch php-fpm-getallheaders.patch 0001-Fix-ZEND_MM_ALIGNMENT-on-m64k.patch +revert-f07b8f36ae8099e29d19fbe8806bc07b21dcd4ac.patch |