1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-03 12:06:35 +00:00
david 77119bb4d8 Use the cached value of recv_fd when removing descriptors from the read
and broadcast lists when a connection is broken, instead of re-reading
the descriptor from the fdinfo struct. The problem was that there were
two calls to rm_fd, and the first one invalidated the data that the
struct pointer pointed to.

For some reason this didn't cause any problems in most situations. Mak
Kolybabi reported that it caused a segfault in
	ncat -l --ssl -k -v 5061 > /dev/null < /dev/zero
With SSL, new connections would try to read memory that was previously
freed, as descriptors were not being removed from the broadcast list as
they were removed from the read list.

You can see the error in these debug logs:

NCAT DEBUG: Closing connection.
NCAT DEBUG: Swapping fd[2] (4) with fd[3] (5)
NCAT DEBUG: Removed fd 4 from list, nfds 3, maxfd 5
NCAT DEBUG: Swapping fd[1] (5) with fd[1] (5)
NCAT DEBUG: Removed fd 5 from list, nfds 1, maxfd 4

The "Remove fd X" should have the same X in both lines.
2010-02-23 20:59:31 +00:00
2010-02-23 06:35:25 +00:00
2010-02-19 06:28:14 +00:00
2010-01-15 03:55:23 +00:00
2008-07-31 14:18:21 +00:00
2010-01-15 03:55:23 +00:00
2010-01-28 19:12:11 +00:00
2010-01-15 03:55:23 +00:00
2009-12-18 07:59:31 +00:00
2010-01-15 03:55:23 +00:00
2010-01-15 03:55:23 +00:00

Here is some documentation for Nmap, but these files are much less
comprehensive than what you'll find at the actual Nmap documentation
site ( http://nmap.org ).
Languages
C 37.5%
Lua 28.1%
C++ 16.8%
Shell 5.8%
Python 4.2%
Other 7.3%