Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Unified Diff: chrome/utility/safe_browsing/mac/udif.cc

Issue 2468263003: Fix a null-deref in safe_browsing::dmg::UDIFParser::ParseBlkx. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/safe_browsing/mac/udif.cc
diff --git a/chrome/utility/safe_browsing/mac/udif.cc b/chrome/utility/safe_browsing/mac/udif.cc
index df7406c5aa16ac4a11c2e4e288d5145e70450e2a..12d7be518c3035fbc43478ee8088ef413a9c07ee 100644
--- a/chrome/utility/safe_browsing/mac/udif.cc
+++ b/chrome/utility/safe_browsing/mac/udif.cc
@@ -494,6 +494,12 @@ bool UDIFParser::ParseBlkx() {
for (CFIndex i = 0; i < CFArrayGetCount(blkx); ++i) {
auto* block_dictionary =
base::mac::CFCast<CFDictionaryRef>(CFArrayGetValueAtIndex(blkx, i));
+ if (!block_dictionary) {
+ DLOG(ERROR) << "Skipping block " << i
+ << " because it is not a CFDictionary";
+ continue;
+ }
+
auto* data = base::mac::GetValueFromDictionary<CFDataRef>(block_dictionary,
CFSTR("Data"));
if (!data) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698