mirror of
https://github.com/nmap/nmap.git
synced 2025-12-31 03:49:01 +00:00
Updated the included libpcap to 1.5.3
This commit is contained in:
@@ -216,7 +216,7 @@ pcap_add_if_win32(pcap_if_t **devlist, char *name, const char *desc,
|
||||
* Win32 implementation, based on WinPcap
|
||||
*/
|
||||
int
|
||||
pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
|
||||
pcap_findalldevs_interfaces(pcap_if_t **alldevsp, char *errbuf)
|
||||
{
|
||||
pcap_if_t *devlist = NULL;
|
||||
int ret = 0;
|
||||
@@ -225,6 +225,24 @@ pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
|
||||
ULONG NameLength;
|
||||
char *name;
|
||||
|
||||
/*
|
||||
* Find out how big a buffer we need.
|
||||
*
|
||||
* This call should always return FALSE; if the error is
|
||||
* ERROR_INSUFFICIENT_BUFFER, NameLength will be set to
|
||||
* the size of the buffer we need, otherwise there's a
|
||||
* problem, and NameLength should be set to 0.
|
||||
*
|
||||
* It shouldn't require NameLength to be set, but,
|
||||
* at least as of WinPcap 4.1.3, it checks whether
|
||||
* NameLength is big enough before it checks for a
|
||||
* NULL buffer argument, so, while it'll still do
|
||||
* the right thing if NameLength is uninitialized and
|
||||
* whatever junk happens to be there is big enough
|
||||
* (because the pointer argument will be null), it's
|
||||
* still reading an uninitialized variable.
|
||||
*/
|
||||
NameLength = 0;
|
||||
if (!PacketGetAdapterNames(NULL, &NameLength))
|
||||
{
|
||||
DWORD last_error = GetLastError();
|
||||
|
||||
Reference in New Issue
Block a user