Check file_id instead of title when setting attachment file id
Not checking the file_id pointer causes a crash when the pointer is null. Bug: b/337264771 Change-Id: I96f3cef0d8cbdd72773c6ebf992bb152657a7ee6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5493871 Reviewed-by: Jiaming Cheng <jiamingc@chromium.org> Commit-Queue: Matthew Mourgos <mmourgos@chromium.org> Cr-Commit-Position: refs/heads/main@{#1293349}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
9fbf3162cb
commit
f68c2719d3
@ -257,7 +257,7 @@ std::vector<Attachment> GetAttachments(const base::Value::Dict& dict) {
|
||||
}
|
||||
|
||||
const std::string* file_id = attachment_dict->FindString(kAttachmentFileId);
|
||||
if (title) {
|
||||
if (file_id) {
|
||||
attachment.set_file_id(*file_id);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user