mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Zero initialize buffer in read_string()
This commit is contained in:
parent
ab678e6c88
commit
db3f109c7d
1 changed files with 1 additions and 1 deletions
|
|
@ -255,7 +255,7 @@ static int read_string(lua_State *L)
|
||||||
int timeout = lua_tointeger(L, 2);
|
int timeout = lua_tointeger(L, 2);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
char *buffer = malloc(size);
|
char *buffer = calloc(1, size);
|
||||||
if (buffer == NULL)
|
if (buffer == NULL)
|
||||||
{
|
{
|
||||||
ret = -1; // Error
|
ret = -1; // Error
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue