1 #include "sass.h" 2 LLVMFuzzerTestOneInput(const uint8_t * data,size_t size)3extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { 4 char* sass_data = (char*) malloc(sizeof(char) * size + 1); 5 if (sass_data == NULL) return 0; 6 7 memcpy(sass_data, data, size); 8 sass_data[size] = '\0'; 9 10 struct Sass_Data_Context* ctx = sass_make_data_context(sass_data); 11 if (ctx == NULL) { 12 free(sass_data); 13 return 0; 14 } 15 16 struct Sass_Options* options = sass_make_options(); 17 if (options == NULL) { 18 sass_delete_data_context(ctx); 19 return 0; 20 } 21 22 sass_option_set_output_style(options, SASS_STYLE_NESTED); 23 sass_option_set_precision(options, 5); 24 25 sass_data_context_set_options(ctx, options); 26 sass_compile_data_context(ctx); 27 28 sass_delete_data_context(ctx); 29 sass_delete_options(options); 30 31 return 0; 32 } 33