mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Sanity check in pcap_recieve to avoid crash. Fixes #313
This commit is contained in:
parent
acd525315d
commit
3749c04310
1 changed files with 3 additions and 0 deletions
|
|
@ -1043,6 +1043,9 @@ static int l_pcap_receive (lua_State *L)
|
|||
{
|
||||
nsock_pool nsp = get_pool(L);
|
||||
nse_nsock_udata *nu = check_nsock_udata(L, 1, true);
|
||||
if (!nu->is_pcap) {
|
||||
return nseU_safeerror(L, "not a pcap socket");
|
||||
}
|
||||
NSOCK_UDATA_ENSURE_OPEN(L, nu);
|
||||
nu->nseid = nsock_pcap_read_packet(nsp, nu->nsiod, pcap_receive_handler,
|
||||
nu->timeout, nu);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue