Avoid uncompressing if uncompressed size is too big.
The uncompressed size might be unreasonable in case the data we
uncompress with GzipUncompress does not have the right format or is
corrupted which will lead to resize to attempt to throw an exception.
The two possible exceptions from resize() are length_error and
bad_alloc. In case the exception attempted is length_error (which I
assumed based on that the error reported is Xlength_error) checking
for std::string::max_size() would avoid such a crash.
Reviewed-by: Ilya Sherman <firstname.lastname@example.org>
Commit-Queue: Monica Salama <email@example.com>
1 file changed