ref: 53838ce01628ba39596625c9edf9d8f5b13a56b4
parent: e2dae8fead1a3b2308b650074a7c139a8cf70fb5
author: Werner Lemberg <[email protected]>
date: Sat Oct 3 17:12:25 EDT 2015
[bzip2, gzip] Avoid access of unitialized memory (#46109). * src/bzip2/ftbzip2.c (ft_bzip2_file_fill_output), src/gzip/ftgzip.c (ft_gzip_file_fill_output): In case of an error, adjust the limit to avoid copying uninitialized memory.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-10-03 Werner Lemberg <[email protected]>
+
+ [bzip2, gzip] Avoid access of unitialized memory (#46109).
+
+ * src/bzip2/ftbzip2.c (ft_bzip2_file_fill_output), src/gzip/ftgzip.c
+ (ft_gzip_file_fill_output): In case of an error, adjust the limit to
+ avoid copying uninitialized memory.
+
2015-10-01 Alexei Podtelezhnikov <[email protected]>
[smooth] Clean up worker.
--- a/src/bzip2/ftbzip2.c
+++ b/src/bzip2/ftbzip2.c
@@ -310,7 +310,8 @@
}
else if ( err != BZ_OK )
{
- error = FT_THROW( Invalid_Stream_Operation );
+ zip->limit = zip->cursor;
+ error = FT_THROW( Invalid_Stream_Operation );
break;
}
}
--- a/src/gzip/ftgzip.c
+++ b/src/gzip/ftgzip.c
@@ -433,7 +433,8 @@
}
else if ( err != Z_OK )
{
- error = FT_THROW( Invalid_Stream_Operation );
+ zip->limit = zip->cursor;
+ error = FT_THROW( Invalid_Stream_Operation );
break;
}
}