Bug 1310518 - fix crashes when downloading files without referrer/source URL, r=mstange

MozReview-Commit-ID: HnSb0yxlAfs

--HG--
extra : rebase_source : 56548450c404702c66e213e327e2083495577382
This commit is contained in:
Gijs Kruitbosch 2016-10-28 17:38:29 +01:00
parent 345cac0665
commit 8d36987e6f

View File

@ -239,11 +239,11 @@ void AddQuarantineMetadataToFile(const CFStringRef filePath,
::CFDictionarySetValue(mutQuarantineProps, kLSQuarantineTypeKey, type);
}
if (!::CFDictionaryGetValue(mutQuarantineProps, kLSQuarantineOriginURLKey)) {
if (!::CFDictionaryGetValue(mutQuarantineProps, kLSQuarantineOriginURLKey) && referrerURL) {
::CFDictionarySetValue(mutQuarantineProps, kLSQuarantineOriginURLKey, referrerURL);
}
if (!::CFDictionaryGetValue(mutQuarantineProps, kLSQuarantineDataURLKey)) {
if (!::CFDictionaryGetValue(mutQuarantineProps, kLSQuarantineDataURLKey) && sourceURL) {
::CFDictionarySetValue(mutQuarantineProps, kLSQuarantineDataURLKey, sourceURL);
}