1 #include <stddef.h> 2 #include <stdint.h> 3 4 #include "fuzzer/FuzzedDataProvider.h" 5 #include "include/pixelusb/UsbGadgetCommon.h" 6 7 using ::android::hardware::google::pixel::usb::setVidPid; 8 LLVMFuzzerTestOneInput(const uint8_t * data,size_t size)9extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { 10 FuzzedDataProvider fdp(data, size); 11 12 std::string vid_str = fdp.ConsumeRandomLengthString(size); 13 std::string pid_str = fdp.ConsumeRemainingBytesAsString(); 14 setVidPid(vid_str.c_str(), pid_str.c_str()); 15 return 0; 16 } 17