tcpdump mailing list archives

tcpdump -i crash


From: Miroslav Lichvar <mlichvar () redhat com>
Date: Mon, 27 Apr 2009 16:12:24 +0200

Hi,

I've received a bug report that tcpdump crashes when -i option is
used and there are no interfaces available.

https://bugzilla.redhat.com/show_bug.cgi?id=497819

This should fix it:

--- a/tcpdump.c
+++ b/tcpdump.c
@@ -655,6 +655,8 @@ main(int argc, char **argv)
                                if (pcap_findalldevs(&devpointer, ebuf) < 0)
                                        error("%s", ebuf);
                                else {
+                                       if (devpointer == NULL)
+                                               error("Invalid adapter index");
                                        for (i = 0; i < devnum-1; i++){
                                                devpointer = devpointer->next;
                                                if (devpointer == NULL)


Thanks,

-- 
Miroslav Lichvar
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: