mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +00:00
Check length of format option before accessing
This commit is contained in:
parent
d91d876905
commit
c40965039b
1 changed files with 4 additions and 1 deletions
|
|
@ -564,7 +564,10 @@ static int lzstream_decompress(lua_State *L) {
|
|||
success = (l == 0) ? lz_test_eof(L, s) : lz_read_chars(L, s, l);
|
||||
}
|
||||
else {
|
||||
const char *p = lua_tostring(L, n);
|
||||
size_t l;
|
||||
const char *p = lua_tolstring(L, n, &l);
|
||||
if (l < 2)
|
||||
return luaL_argerror(L, n, "invalid format");
|
||||
luaL_argcheck(L, p && p[0] == '*', n, "invalid option");
|
||||
switch (p[1]) {
|
||||
case 'l': /* line */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue