Skip to content

Commit

Permalink
twrpDigest: don't crash when zip.md5 file is empty
Browse files Browse the repository at this point in the history
Change-Id: I14145b32c7993bb0cd236b2982ed00bc2c791282
  • Loading branch information
that1 authored and mdmower committed Mar 9, 2017
1 parent 077e1c7 commit fc4ff5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion twrpDigest.cpp
Expand Up @@ -147,7 +147,7 @@ int twrpDigest::verify_md5digest(void) {
snprintf(hex, 3, "%02x", md5sum[i]);
md5str += hex;
}
if (tokens.at(0) != md5str)
if (tokens.empty() || tokens.at(0) != md5str)
return MD5_MATCH_FAIL;

return MD5_OK;
Expand Down

0 comments on commit fc4ff5c

Please sign in to comment.