From d1afb52fea006771c968c3f27b1598811fdf8824 Mon Sep 17 00:00:00 2001 From: that Date: Thu, 23 Feb 2017 23:05:59 +0100 Subject: twrpDigest: don't crash when zip.md5 file is empty Change-Id: I14145b32c7993bb0cd236b2982ed00bc2c791282 --- twrpDigest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twrpDigest.cpp b/twrpDigest.cpp index d1217cb6a..a9ba20a38 100644 --- a/twrpDigest.cpp +++ b/twrpDigest.cpp @@ -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; -- cgit v1.2.3