Coverage Report

Created: 2023-08-27 06:20

/src/testdir/tests/luaL_buffaddr_test.c
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
718
{
12
718
  lua_State *L = luaL_newstate();
13
718
  if (L == NULL)
14
0
    return 0;
15
16
718
  luaL_Buffer buf;
17
718
  char *s = luaL_buffinitsize(L, &buf, size);
18
718
  memcpy(s, data, size);
19
718
  luaL_pushresultsize(&buf, size);
20
718
  if (luaL_buffaddr(&buf) == NULL)
21
0
    return 0;
22
23
718
  lua_settop(L, 0);
24
718
  lua_close(L);
25
26
718
  return 0;
27
718
}