webrtc_m130/test/fuzzers/field_trial_fuzzer.cc
Benjamin Wright ade5cb8294 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}
2019-03-12 20:47:15 +00:00

26 lines
798 B
C++

/*
* 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