This fix was previously applied to ncat_listen's read_socket in r36652
(ac8b866) as a fix for #773. It didn't fully solve the problem, though,
since the fix should have been applied in ncat_core's fdinfo_recv, right
after the call to SSL_read. This commit moves the fix where it belongs,
which also simplifies the code.
Fixes#197 and #1049.
for file in `grep "* including the terms and conditions of this license text as well. \*" * -r --files-with-match `; do sed "s/\* including the terms and conditions of this license text as well. \*/* including the terms and conditions of this license text as well. */g" -i $file; done
Have lua_setup return the state it creates. Store the state created from
--lua-exec in the global options table. Use a temporary local for
--lua-exec-internal.
This eliminates the ambiguity that could exist when, say, both o.udp and
o.sctp were both set. The code would use whichever it happened to test
first. This also makes TCP mode explicit with IPPROTO_TCP.
Resolves these Parfait reports
(http://seclists.org/nmap-dev/2012/q4/412).
Error: Null pointer dereference (CWE 476)
Read from null pointer 'fdn'
at line 328 of components/nmap/build/amd64/ncat/ncat_core.c in function 'blocking_fdinfo_send'.
Function 'get_fdinfo' may return constant 'NULL' at line 615, called at line 366 in function 'ncat_broadcast'.
Constant 'NULL' passed into function 'blocking_fdinfo_send', argument 'fdn', from call at line 367.
Null pointer introduced at line 615 of components/nmap/build/amd64/ncat/util.c in function 'get_fdinfo'.
at line 330 of components/nmap/build/amd64/ncat/ncat_core.c in function 'blocking_fdinfo_send'.
Function 'get_fdinfo' may return constant 'NULL' at line 615, called at line 366 in function 'ncat_broadcast'.
Constant 'NULL' passed into function 'blocking_fdinfo_send', argument 'fdn', from call at line 367.
Null pointer introduced at line 615 of components/nmap/build/amd64/ncat/util.c in function 'get_fdinfo'.
Error: Null pointer dereference (CWE 476)
Read from null pointer 'fdn'
at line 946 of components/nmap/build/amd64/ncat/ncat_listen.c in function 'shutdown_sockets'.
Function 'get_fdinfo' may return constant 'NULL' at line 615, called at line 945.
Null pointer introduced at line 615 of components/nmap/build/amd64/ncat/util.c in function 'get_fdinfo'.
compatibility between systems and use cases. [Henri Doreau]
There were known issues with the following cases:
* epoll and regular files
* kqueue and regular files
* WSAPoll and stdin
The --nsock-engine=<ENGINE> can still be used to bypass this
default choice.
See: http://seclists.org/nmap-dev/2012/q4/173