Commit edc5c248 authored by Jasper Chapman-Black's avatar Jasper Chapman-Black Committed by Commit Bot

SuperSize: Caspian: Don't crash on empty component list

Sparse .sizediffs may have zero symbols, and so zero components.

Change-Id: I8d24f5715c6b82ea38b544ffa4a8aaad5b988b69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1945275Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Jasper Chapman-Black <jaspercb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720672}
parent 0da61475
...@@ -262,8 +262,8 @@ void ParseSizeInfo(const char* gzipped, unsigned long len, SizeInfo* info) { ...@@ -262,8 +262,8 @@ void ParseSizeInfo(const char* gzipped, unsigned long len, SizeInfo* info) {
if (has_components) { if (has_components) {
// List of component names // List of component names
int n_components = ReadLoneInt(&rest); int n_components = ReadLoneInt(&rest);
if (n_components <= 0) { if (n_components < 0) {
std::cerr << "Unexpected non-positive components list length: " std::cerr << "Unexpected negative components list length: "
<< n_components << std::endl; << n_components << std::endl;
exit(1); exit(1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment