Have you considered telling your LLM that argc and argv actually come from glibc?
I've pointed out some issues with your issues below:
> On Wednesday, January 21, 2026 at 3:15:57AM UTC+10 checkmate wrote:
> ## Summary
Google groups doesn't do markdown.
> An issue has been identified in the Lua interpreter, specifically in the
> `handle_script` function located in `lua.c`. The vulnerability is categorized
> under CWE-476 (NULL Pointer Dereference).
>
> ## Vulnerability Details
>
> The vulnerability arises from the lack of validation for pointer arguments
> passed to the `strcmp` function. In the `handle_script` function, the following
> issues are noted:
>
> - The `argv` array is derived from user input through `lua_touserdata` in the
> `pmain` function, which can potentially lead to unchecked user-controlled
> input.
The argc and argv array actually come from glibc (see [1]) and there is no way
to call pmain with other arguments
[1]:
https://www.gnu.org/software/c-intro-and-ref/manual/html_node/The-main-Function.html
> - The line `const char *fname = argv[0];` assigns `fname` to the first element
> of `argv`. If `script` is equal to `argc`, `arg[0]` becomes NULL when it is
> used in `strcmp(fname, "-")`, leading to a NULL pointer dereference.
> Additionally, using `strcmp(argv[-1], "--")` may dereference an out-of-bounds
> or NULL pointer.
The script variable is modified by the collectargs function and there are
checks to make sure that either script is -1 or 0 or argv[script] is never NULL
> - There is no explicit or implicit sanitization for NULL pointers before these
> calls to `strcmp`, resulting in a continuous tainted data flow from user
> input to the sink.
The only potential thing would be is if there was a way to have
argv[0] == NULL and argv[1] == "-" which I'm not sure can be done
> ## Affected Code Snippet
>
> Here is the relevant section of the `handle_script` function in `lua.c`:
>
> ```c
> 129: int handle_script (lua_State *L, char **argv) {
The proper line numbers are actually 258 to 269. Also you've dropped line "130".
> 131: const char *fname = argv[0];
> 132: if (strcmp(fname, "-") == 0 && strcmp(argv[-1], "--") != 0)
> 133: fname = NULL;
> 134: status = luaL_loadfile(L, fname);
> 135: if (status == LUA_OK) {
> 136: int n = pushargs(L);
> 137: status = docall(L, n, LUA_MULTRET);
> 138: }
> 139: return report(L, status);
> 140: }
> ```
There are some comments here. Don't modify "quoted" code.
This is the actual real code below (lines 258-269)
https://github.com/lua/lua/blob/0b73ed8f083c99b5ff88e0822532db7ad8785881/lua.c#L258-L269 static int handle_script (lua_State *L, char **argv) {
int status;
const char *fname = argv[0];
if (strcmp(fname, "-") == 0 && strcmp(argv[-1], "--") != 0)
fname = NULL; /* stdin */
status = luaL_loadfile(L, fname);
if (status == LUA_OK) {
int n = pushargs(L); /* push arguments to script */
status = docall(L, n, LUA_MULTRET);
}
return report(L, status);
}
> ## Conclusion
>
> Due to the lack of pointer validation and potential for NULL dereference in
> multiple areas, this is a critical vulnerability that needs immediate
> attention. All code interactions that involve user input should be reviewed to
> ensure proper validation mechanisms are in place.
If you are allowing user input on your command line you probably have worse things
to worry about. Also having user input in Lua code is even worse, since you can load
precompiled code and also have access to the debug library.
> ## Version
>
> This issue has been identified in version `0b73ed8f083c99b5ff88e0822532db7ad8785881`.
This commit is actually 30 commits before the 5.5.0 release