Commit 1d1b4704 authored by Bhargava Shastry's avatar Bhargava Shastry

ossfuzz: Add simple mruby compile test harness

parent e6bad676
#include <stdlib.h>
#include <string.h>
#include <mruby.h>
#include <mruby/compile.h>
int LLVMFuzzerTestOneInput(uint8_t *Data, size_t size) {
if (size < 1) {
return 0;
}
char *code = malloc(size+1);
memcpy(code, Data, size);
code[size] = '\0';
mrb_state *mrb = mrb_open();
mrb_load_string(mrb, code);
mrb_close(mrb);
free(code);
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment