1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
Description: fix segfaults due to uninitialized variables.
Bug: http://bugs.debian.org/599746
Author: Chow Loong Jin <hyperair@ubuntu.com>
Last-Update: 2010-10-11
Index: tcpxtract-1.0.1/sessionlist.c
===================================================================
--- tcpxtract-1.0.1.orig/sessionlist.c
+++ tcpxtract-1.0.1/sessionlist.c
@@ -62,6 +62,10 @@ slist_t *add_session(slist_t **slist, co
(*last_slist)->prev = slist_ptr;
(*last_slist)->next = NULL;
(*last_slist)->srchptr_list = NULL;
+ (*last_slist)->extract_list = NULL;
+ (*last_slist)->recording = 0;
+ (*last_slist)->last_recvd = 0;
+ (*last_slist)->last_seqnum = 0;
return *last_slist;
}
Index: tcpxtract-1.0.1/tcpxtract.c
===================================================================
--- tcpxtract-1.0.1.orig/tcpxtract.c
+++ tcpxtract-1.0.1/tcpxtract.c
@@ -237,7 +237,7 @@ int main(int argc, char *argv[])
{
int c;
char *capfname = NULL; /* Capture file for input */
- char *dev; /* Sniffing devise */
+ char *dev = NULL; /* Sniffing devise */
char errbuf[PCAP_ERRBUF_SIZE]; /* Error buffer */
struct bpf_program filter; /* hold compiled program */
@@ -283,7 +283,7 @@ int main(int argc, char *argv[])
break;
case 'o':
if (optarg[strlen(optarg) - 1] != '/') {
- output_prefix = emalloc(strlen(optarg) + 1);
+ output_prefix = emalloc(strlen(optarg) + 2);
strcpy(output_prefix, optarg);
output_prefix[strlen(optarg)] = '/';
output_prefix[strlen(optarg) + 1] = '\0';
|