Coverage Report

Created: 2023-09-30 06:14

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