Field trial fuzzer.
This simple fuzzer is intended to detect potential issues in the field trial parsing code. Since these can be set by the browser it is better to have some fuzzing coverage around this area. Bug: webrtc:10395 Change-Id: I1b8b859d2107a0bc99cb7520cf0ef96f3d110547 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127121 Commit-Queue: Benjamin Wright <benwright@webrtc.org> Reviewed-by: Qingsi Wang <qingsi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27087}
This commit is contained in:

committed by
Commit Bot

parent
fa852efb73
commit
ade5cb8294
@ -558,3 +558,13 @@ webrtc_fuzzer_test("url_decode_fuzzer") {
|
|||||||
"../../rtc_base:rtc_base_approved",
|
"../../rtc_base:rtc_base_approved",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
webrtc_fuzzer_test("field_trial_fuzzer") {
|
||||||
|
sources = [
|
||||||
|
"field_trial_fuzzer.cc",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
"../../system_wrappers:field_trial",
|
||||||
|
]
|
||||||
|
seed_corpus = "corpora/field_trial-corpus"
|
||||||
|
}
|
||||||
|
1
test/fuzzers/corpora/field_trial-corpus/field-trial-0
Normal file
1
test/fuzzers/corpora/field_trial-corpus/field-trial-0
Normal file
@ -0,0 +1 @@
|
|||||||
|
WebRTC-DecoderDataDumpDirectory/Enabled/
|
1
test/fuzzers/corpora/field_trial-corpus/field-trial-1
Normal file
1
test/fuzzers/corpora/field_trial-corpus/field-trial-1
Normal file
@ -0,0 +1 @@
|
|||||||
|
WebRTC-DecoderDataDumpDirectory/Disabled/
|
1
test/fuzzers/corpora/field_trial-corpus/field-trial-2
Normal file
1
test/fuzzers/corpora/field_trial-corpus/field-trial-2
Normal file
@ -0,0 +1 @@
|
|||||||
|
WebRTC-DecoderDataDumpDirectory/Disabled/WebRTC-IPv6Default/Enabled/
|
25
test/fuzzers/field_trial_fuzzer.cc
Normal file
25
test/fuzzers/field_trial_fuzzer.cc
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "system_wrappers/include/field_trial.h"
|
||||||
|
|
||||||
|
namespace webrtc {
|
||||||
|
|
||||||
|
void FuzzOneInput(const uint8_t* data, size_t size) {
|
||||||
|
std::string field_trial(reinterpret_cast<const char*>(data), size);
|
||||||
|
field_trial::InitFieldTrialsFromString(field_trial.c_str());
|
||||||
|
field_trial::FindFullName(field_trial);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace webrtc
|
Reference in New Issue
Block a user