Package: tcptrack
Version: 1.3.0-1
Severity: important
Tags: patch

tcptrack crashes with the following assertion on my mac-mini (a
PPC, so a big-engian system):

tcptrack: IPv4Packet.cc:14: IPv4Packet::IPv4Packet(const u_char*,
unsigned int): Assertion `ip->ip_v == 4' failed.

The cause:
The headers.h file does not include 'config.h', as a result the sniff_ip
structure is compiled in little-endian format iso big-endian. 
The code in Sniffer.cc knows the packet is IPv4 (because the ethernet
header says so) but the following code, which uses the sniff_ip struct,
thinks it's not.

I suspect this could also occur with invalid or maliciously crafted
packets. The attached patch only fixes the endianness of the struct.

-- System Information:
Debian Release: 5.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: powerpc (ppc)

Kernel: Linux 2.6.28-rc4
Locale: LANG=C, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages tcptrack depends on:
ii  libc6                     2.7-16         GNU C Library: Shared libraries
ii  libgcc1                   1:4.3.2-1      GCC support library
ii  libncurses5               5.7+20081213-1 shared libraries for terminal hand
ii  libpcap0.8                0.9.8-5        system interface for user-level pa
ii  libstdc++6                4.3.2-1        The GNU Standard C++ Library v3

tcptrack recommends no packages.

tcptrack suggests no packages.

-- no debconf information
diff --git a/src/headers.h b/src/headers.h
index 7439fc8..fe60d39 100644
--- a/src/headers.h
+++ b/src/headers.h
@@ -27,6 +27,7 @@
 #include <unistd.h> // needed on BSD
 #include <netinet/in.h>
 #include <netinet/tcp.h>
+#include "config.h"
 
 #ifndef BYTE_ORDER
 #ifdef WORDS_BIGENDIAN

Reply via email to