Line | Count | Source (jump to first uncovered line) |
1 | #include <stdint.h> | |
2 | #include <stddef.h> | |
3 | #include <string.h> | |
4 | #include <stdlib.h> | |
5 | ||
6 | #include "lua.h" | |
7 | #include "lualib.h" | |
8 | #include "lauxlib.h" | |
9 | ||
10 | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) | |
11 | 713 | { |
12 | 713 | lua_State *L = luaL_newstate(); |
13 | 713 | if (L == NULL) |
14 | 0 | return 0; |
15 | ||
16 | 713 | char *buf = malloc(size + 1); |
17 | 713 | if (buf == NULL) |
18 | 0 | return 0; |
19 | 713 | memcpy(buf, data, size); |
20 | 713 | buf[size] = '\0'; |
21 | ||
22 | 713 | luaL_traceback(L, L, buf, 1); |
23 | ||
24 | 713 | free(buf); |
25 | 713 | lua_settop(L, 0); |
26 | 713 | lua_close(L); |
27 | ||
28 | 713 | return 0; |
29 | 713 | } |