Files
ESP-Scope/managed_components/espressif__cjson/cJSON/fuzzing/fuzz_main.c
en 1293fe9c44
Some checks failed
Release Firmware / build (boards/default.h, 9, 2, esp32, esp32) (push) Failing after 30m22s
Release Firmware / build (boards/xiao_esp32c6.h, 0, 8, xiao-esp32c6, esp32c6) (push) Failing after 1m35s
Release Firmware / release (push) Has been skipped
初始提交:ESP-Scope 网页示波器固件(ESP32-S3)
基于 vtalpaert/esp-scope 编译
- 采样率 1Hz-83kHz
- ADC1_CH0 (GPIO 1) 输入
- WiFi AP + Web UI
- 内置 PWM 测试信号 (GPIO 4)
- 单通道,0-3.3V 输入范围
2026-07-02 23:42:08 +08:00

55 lines
992 B
C

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); /* required by C89 */
/* fuzz target entry point, works without libFuzzer */
int main(int argc, char **argv)
{
FILE *f;
char *buf = NULL;
long siz_buf;
if(argc < 2)
{
fprintf(stderr, "no input file\n");
goto err;
}
f = fopen(argv[1], "rb");
if(f == NULL)
{
fprintf(stderr, "error opening input file %s\n", argv[1]);
goto err;
}
fseek(f, 0, SEEK_END);
siz_buf = ftell(f);
rewind(f);
if(siz_buf < 1) goto err;
buf = (char*)malloc((size_t)siz_buf);
if(buf == NULL)
{
fprintf(stderr, "malloc() failed\n");
goto err;
}
if(fread(buf, (size_t)siz_buf, 1, f) != 1)
{
fprintf(stderr, "fread() failed\n");
goto err;
}
(void)LLVMFuzzerTestOneInput((uint8_t*)buf, (size_t)siz_buf);
err:
free(buf);
return 0;
}