New issue
Advanced search Search tips

Issue 598869 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Clean up CastChannelOpenFunction not to parse IP address twice

Project Member Reported by w...@chromium.org, Mar 29 2016

Issue description

What steps will reproduce the problem?
(1) Call e.g. the open() API for CastChannel, with a malformed IP literal.

What is the expected output?

Expect that Chrome reports an error.

What do you see instead?

Chrome will CHECK.

This makes Chrome fragile to bugs in the Media Router / Cast Extension; the API should be switched to fail on malformed input, rather than crashing the entire browser.

 

Comment 1 by w...@chromium.org, Mar 29 2016

Owner: w...@chromium.org
Status: Assigned (was: Untriaged)

Comment 2 by mfo...@chromium.org, Mar 30 2016

This doesn't repro for me.

chrome.cast.channel.open({ipAddress: 'foo', port: 8009, auth: 'ssl_verified'}, function (c) {});
undefined
extensions::lastError:133 Unchecked runtime.lastError while running cast.channel.open: Invalid connect_info (invalid IP address)reportIfUnchecked @ extensions::lastError:133handleResponse @ extensions::sendRequest:78

That being said I don't object to setting some kind of "unknown error" in open() if there's a possibility of something weird happening after all of the other validations occur.

Comment 3 by w...@chromium.org, Apr 1 2016

Summary: Clean up CastChannelOpenFunction not to parse IP address twice (was: CastChannel APIs should fail on malformed input, rather than CHECK)
Yes, you're right; seems strange that we do two separate parsing operations, one to verify and one to get the value; will take a look at cleaning that up.

Comment 4 by w...@chromium.org, Nov 28 2016

Owner: lethalantidote@chromium.org
CJ, want to take a stab at this bit of refactoring?
Status: Fixed (was: Assigned)
Looks like it was already done. Closing out.

Sign in to add a comment