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

Issue 373016: Bulletproof the url going into a std::string and ensure it's not going to... (Closed)

Created:
11 years, 1 month ago by pink (ping after 24hrs)
Modified:
9 years, 7 months ago
Reviewers:
viettrungluu
CC:
chromium-reviews_googlegroups.com, John Grabowski, pam+watch_chromium.org, ben+cc_chromium.org
Visibility:
Public.

Description

Bulletproof the url going into a std::string and ensure it's not going to be NULL, which throws and exception. BUG=26883 TEST=dragging things into the content area (urls, images, text, etc) Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=31312

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -5 lines) Patch
M chrome/browser/cocoa/web_drop_target.mm View 1 chunk +12 lines, -5 lines 1 comment Download

Messages

Total messages: 4 (0 generated)
pink (ping after 24hrs)
11 years, 1 month ago (2009-11-06 21:15:18 UTC) #1
viettrungluu
LGTM with comment below addressed. http://codereview.chromium.org/373016/diff/1/2 File chrome/browser/cocoa/web_drop_target.mm (right): http://codereview.chromium.org/373016/diff/1/2#newcode196 Line 196: data->url_title = base::SysNSStringToUTF16([titles ...
11 years, 1 month ago (2009-11-06 21:29:17 UTC) #2
pink (ping after 24hrs)
We're fixing the SysNSString* calls to accept nil and return empty string as part of ...
11 years, 1 month ago (2009-11-06 21:34:25 UTC) #3
viettrungluu
11 years, 1 month ago (2009-11-06 21:36:50 UTC) #4
Okay, LGTM on this change. Do we have a bug filed for the SysNSString* calls to
make sure it doesn't get lost in the shuffle?

On 2009/11/06 21:34:25, pink wrote:
> We're fixing the SysNSString* calls to accept nil and return empty
> string as part of a cl that's currently ongoing.
> 
> On Fri, Nov 6, 2009 at 4:29 PM,  <mailto:viettrungluu@chromium.org> wrote:
> > LGTM with comment below addressed.
> >
> >
> > http://codereview.chromium.org/373016/diff/1/2
> > File chrome/browser/cocoa/web_drop_target.mm (right):
> >
> > http://codereview.chromium.org/373016/diff/1/2#newcode196
> > Line 196: data->url_title =3D base::SysNSStringToUTF16([titles
> > objectAtIndex:0]);
> > I'm 99.99% sure that |SysNSStringToUTF16()| chokes if passed nil, so
> > this should be something like:
> >
> > =A0if (NSString* title =3D [titles objectAtIndex:0])
> > =A0 =A0data->url_title =3D base::SysNSStringToUTF16(title);
> >
> > (|-objectAtIndex:| shouldn't return nil, but is there any guarantee that
> > |titles| isn't nil?)
> >
> > http://codereview.chromium.org/373016
> >
> 
> 
> 
> --=20
> Mike Pinkerton
> Mac Weenie
> mailto:pinkerton@google.com

Powered by Google App Engine
This is Rietveld 408576698