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

Unified Diff: base/test/fuzzed_data_provider.h

Issue 2469813002: Add a URLRequest FTP fuzzer. (Closed)
Patch Set: merge Created 4 years, 1 month 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 | « no previous file | base/test/fuzzed_data_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/fuzzed_data_provider.h
diff --git a/base/test/fuzzed_data_provider.h b/base/test/fuzzed_data_provider.h
index 9f048f363e803dcadb12542fc1b5f61dbefe53c8..425c820a219a07ef9c7d94967dad98db8946c058 100644
--- a/base/test/fuzzed_data_provider.h
+++ b/base/test/fuzzed_data_provider.h
@@ -33,6 +33,12 @@ class FuzzedDataProvider {
// Returns a std::string containing all remaining bytes of the input data.
std::string ConsumeRemainingBytes();
+ // Returns a std::string of length from 0 to |max_length|. When it runs out of
+ // input data, returns what remains of the input. Designed to be more stable
+ // with respect to a fuzzer inserting characters than just picking a random
+ // length and then consuming that many bytes with ConsumeBytes().
+ std::string ConsumeRandomLengthString(size_t max_length);
+
// Returns a number in the range [min, max] by consuming bytes from the input
// data. The value might not be uniformly distributed in the given range. If
// there's no input data left, always returns |min|. |min| must be less than
« no previous file with comments | « no previous file | base/test/fuzzed_data_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698