1 #include <stdlib.h> 2 #include <stdint.h> 3 #include <string.h> 4 #include <poppler.h> 5 LLVMFuzzerTestOneInput(const uint8_t * data,size_t size)6extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 7 { 8 char *tmp_ch; 9 char *buf; 10 gsize length; 11 guint8 *tmp_uint; 12 13 buf = (char *)calloc(size + 1, sizeof(char)); 14 memcpy(buf, data, size); 15 buf[size] = '\0'; 16 17 tmp_ch = poppler_named_dest_from_bytestring((const guint8 *)buf, size); 18 tmp_uint = poppler_named_dest_to_bytestring(buf, &length); 19 20 g_free(tmp_ch); 21 g_free(tmp_uint); 22 free(buf); 23 return 0; 24 } 25