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

Issue 2164223003: Mac File Dialogs: Fix crash due to adding nil value to an NSMutableSet. (Closed)

Created:
4 years, 5 months ago by karandeepb
Modified:
4 years, 5 months ago
Reviewers:
Avi (use Gerrit)
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac File Dialogs: Fix crash due to adding nil value to an NSMutableSet. Crash reports beginning from Chrome V48 suggest that CreateUTIFromExtension may return nil. This causes a crash when the uti string is added to the NSMutableSet which holds the uti strings corresponding to the extension dropdown. This CL does a nil check before adding the string to the set, which should prevent the crash. BUG=630101 Committed: https://crrev.com/d338ac5a24ba53dae98c779346e371c29f02ebed Cr-Commit-Position: refs/heads/master@{#407114}

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -1 line) Patch
M ui/shell_dialogs/select_file_dialog_mac.mm View 1 chunk +4 lines, -1 line 2 comments Download

Dependent Patchsets:

Messages

Total messages: 12 (5 generated)
karandeepb
PTAL avi@. Thanks.
4 years, 5 months ago (2016-07-21 05:37:47 UTC) #3
Avi (use Gerrit)
LGTM with request. https://codereview.chromium.org/2164223003/diff/1/ui/shell_dialogs/select_file_dialog_mac.mm File ui/shell_dialogs/select_file_dialog_mac.mm (right): https://codereview.chromium.org/2164223003/diff/1/ui/shell_dialogs/select_file_dialog_mac.mm#newcode32 ui/shell_dialogs/select_file_dialog_mac.mm:32: kUTTagClassFilenameExtension, ext_cf.get(), NULL); The documentation (https://developer.apple.com/library/mac/documentation/MobileCoreServices/Reference/UTTypeRef/) ...
4 years, 5 months ago (2016-07-21 14:25:20 UTC) #4
karandeepb
https://codereview.chromium.org/2164223003/diff/1/ui/shell_dialogs/select_file_dialog_mac.mm File ui/shell_dialogs/select_file_dialog_mac.mm (right): https://codereview.chromium.org/2164223003/diff/1/ui/shell_dialogs/select_file_dialog_mac.mm#newcode32 ui/shell_dialogs/select_file_dialog_mac.mm:32: kUTTagClassFilenameExtension, ext_cf.get(), NULL); On 2016/07/21 14:25:20, Avi wrote: > ...
4 years, 5 months ago (2016-07-22 09:17:16 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2164223003/1
4 years, 5 months ago (2016-07-22 09:18:03 UTC) #7
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 5 months ago (2016-07-22 09:48:03 UTC) #9
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/d338ac5a24ba53dae98c779346e371c29f02ebed Cr-Commit-Position: refs/heads/master@{#407114}
4 years, 5 months ago (2016-07-22 09:49:33 UTC) #11
Avi (use Gerrit)
4 years, 5 months ago (2016-07-22 15:47:55 UTC) #12
Message was sent while issue was closed.
On 2016/07/22 09:17:16, karandeepb wrote:
>
https://codereview.chromium.org/2164223003/diff/1/ui/shell_dialogs/select_fil...
> File ui/shell_dialogs/select_file_dialog_mac.mm (right):
> 
>
https://codereview.chromium.org/2164223003/diff/1/ui/shell_dialogs/select_fil...
> ui/shell_dialogs/select_file_dialog_mac.mm:32: kUTTagClassFilenameExtension,
> ext_cf.get(), NULL);
> On 2016/07/21 14:25:20, Avi wrote:
> > The documentation
> >
>
(https://developer.apple.com/library/mac/documentation/MobileCoreServices/Refe...)
> > says that this should only return NULL if the tag class is unknown, not if
the
> > tag is unknown.
> > 
> > Please file a radar with Apple.
> 
> Filed rdar://27490414.  Although can't reproduce this manually and this is a
> fairly rare crash.

Awesome; can you add that link to the code in the comment?

Powered by Google App Engine
This is Rietveld 408576698