From 5bcbfc91fbae039934dd8717c757247244a8668a Mon Sep 17 00:00:00 2001 From: gamelinux Date: Wed, 2 May 2012 17:42:20 +0000 Subject: [PATCH] Fixed segfault when unable to read pcap - Thanks to Joe Moore --- src/passivedns.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/passivedns.c b/src/passivedns.c index b78c14f..3180345 100644 --- a/src/passivedns.c +++ b/src/passivedns.c @@ -1142,6 +1142,11 @@ int main(int argc, char *argv[]) } + if (config.handle == NULL) { + game_over(); + return (1); + } + /** segfaults on empty pcap! */ if ((pcap_compile(config.handle, &config.cfilter, config.bpff, 1, config.net_mask)) == -1) { olog("[*] Error pcap_compile user_filter: %s\n", pcap_geterr(config.handle));