Merge "twrpDigest: don't crash when zip.md5 file is empty" into android-7.1

This commit is contained in:
big biff
2017-03-01 01:10:24 +01:00
committed by Gerrit Code Review
+1 -1
View File
@@ -154,7 +154,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;