Commit d4a6aaa8 authored by Piotr Pawliczek's avatar Piotr Pawliczek Committed by Commit Bot

chromeos/printing: Small fix in URL parsing

This patch modifies CHECK condition in a function responsible for
extracting hostname and port from given URI. The previous CHECK
version was activated for some boundary cases like "://".

BUG=none
TEST=on my workstation with the fuzzer from CL:2079133

Change-Id: Ie5604128b1f5ae4e0ab97117421dd1f79f2f8b38
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2080713
Commit-Queue: Sean Kau <skau@chromium.org>
Reviewed-by: default avatarSean Kau <skau@chromium.org>
Auto-Submit: Piotr Pawliczek <pawliczek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745653}
parent 7e1399ca
...@@ -99,7 +99,7 @@ base::StringPiece HostAndPort(base::StringPiece uri) { ...@@ -99,7 +99,7 @@ base::StringPiece HostAndPort(base::StringPiece uri) {
hostname_end = uri.size(); hostname_end = uri.size();
} }
CHECK_GT(hostname_end, hostname_start); CHECK_GE(hostname_end, hostname_start);
return uri.substr(hostname_start, hostname_end - hostname_start); return uri.substr(hostname_start, hostname_end - hostname_start);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment