[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Possible debug.debug bug
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 8 Jun 2020 11:35:01 -0300
> db_debug has these lines:
>
> if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") ||
> lua_pcall(L, 0, 0, 0))
> lua_writestringerror("%s\n", lua_tostring(L, -1));
>
> lua_writestringerror is defined as:
>
> #define lua_writestringerror(s,p) \
> (fprintf(stderr, (s), (p)), fflush(stderr))
>
> lua_tostring may return NULL if the error object that lua_pcall pushes onto the
> stack is not a string. In this case NULL is passed to fprintf, which is
> undefined behavior.
Thanks for the report.
-- Roberto