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

Unified Diff: net/base/data_url.cc

Issue 1735043004: Add fuzz testers to //net for some functions with simple parsing APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/DEPS ('k') | net/base/parse_data_url_fuzzer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/data_url.cc
diff --git a/net/base/data_url.cc b/net/base/data_url.cc
index 07b8fb00bb5344dcc02dd1bb20950aabcd344fe0..4d29bf6f128f8d5ef078c6369c19b6755cb0cfa6 100644
--- a/net/base/data_url.cc
+++ b/net/base/data_url.cc
@@ -21,6 +21,9 @@ namespace net {
// static
bool DataURL::Parse(const GURL& url, std::string* mime_type,
std::string* charset, std::string* data) {
+ if (!url.is_valid())
+ return false;
+
DCHECK(mime_type->empty());
DCHECK(charset->empty());
std::string::const_iterator begin = url.spec().begin();
« no previous file with comments | « net/DEPS ('k') | net/base/parse_data_url_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698