openresty / openresty/lua-nginx-module
Code Inconsistencies Detected by Static Analysis
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 11.8k
- Forks
- 2.1k
- Avg merge
- 6h 1m
- Merged PRs (30d)
- 6
Description
Return value of a function lua_touserdata is dereferenced without checking for NULL, but it is usually checked for this function:
Similar issue with fucntion ngx_http_lua_get_req:
After having been compared to a NULL value:
pointer server_name->data is dereferenced without null check by calling function memcpy:
https://github.com/openresty/lua-nginx-module/blob/9688812a4eba47c1f43892c998e50b988d740f5d/src/ngx_http_lua_socket_tcp.c#L1855-L1857
Found by Linux Verification Center with SVACE
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/ngx_http_lua_socket_tcp.c at the cited ranges around lines 1814, 1855, 4662, and 5112. Compare the lua_touserdata, ngx_http_lua_get_req, and server_name->data uses with nearby NULL-checking patterns, then rerun SVACE or the repository's static analysis to confirm the reported findings are resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, lua, nginx
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100