Commit 4964a916 authored by Laís Minchillo's avatar Laís Minchillo Committed by Commit Bot

[aw] Don't allow null host string in setProxyOverride

Null Java strings shouldn't be passed down to C++ code. This CL adds
code to check for a null host string or null strings in exclusionList
and throw a null pointer exception.

Bug: 896285
Change-Id: I6af64350de8a93031741c8951a7efe2df7111ccd
Reviewed-on: https://chromium-review.googlesource.com/c/1286849Reviewed-by: default avatarTobias Sargeant <tobiasjs@chromium.org>
Commit-Queue: Laís Minchillo <laisminchillo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600731}
parent 087a06d7
......@@ -119,6 +119,16 @@ public class SharedStatics {
}
public void setProxyOverride(String host, int port, String[] exclusionList, Runnable callback) {
if (host == null) {
throw new NullPointerException("Host string should not be null");
}
if (exclusionList != null) {
for (String url : exclusionList) {
if (url == null) {
throw new NullPointerException("Excluded URL strings should not be null");
}
}
}
ThreadUtils.runOnUiThread(
() -> AwContentsStatics.setProxyOverride(host, port, exclusionList, callback));
}
......
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