1 |
jlec 10/11/28 09:29:02 |
2 |
|
3 |
Added: 3.0.0-buffer-overflow.patch |
4 |
Log: |
5 |
Fixes for overflows buffers taken from debian |
6 |
|
7 |
(Portage version: 2.2.0_alpha6/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 net-analyzer/iptraf/files/3.0.0-buffer-overflow.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/iptraf/files/3.0.0-buffer-overflow.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/iptraf/files/3.0.0-buffer-overflow.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: 3.0.0-buffer-overflow.patch |
16 |
=================================================================== |
17 |
Patch adopted from debians patches |
18 |
|
19 |
diff --git a/src/hostmon.c b/src/hostmon.c |
20 |
index 14df2c8..7e50575 100644 |
21 |
--- a/src/hostmon.c |
22 |
+++ b/src/hostmon.c |
23 |
@@ -711,7 +711,7 @@ void hostmon(const struct OPTIONS *options, int facilitytime, char *ifptr, |
24 |
int is_ip; |
25 |
int ch; |
26 |
|
27 |
- char ifname[10]; |
28 |
+ char ifname[18]; |
29 |
|
30 |
struct timeval tv; |
31 |
unsigned long starttime; |
32 |
diff --git a/src/ifstats.c b/src/ifstats.c |
33 |
index fac4db5..583279a 100644 |
34 |
--- a/src/ifstats.c |
35 |
+++ b/src/ifstats.c |
36 |
@@ -129,7 +129,7 @@ void initiflist(struct iflist **list) |
37 |
{ |
38 |
FILE *fd; |
39 |
char buf[161]; |
40 |
- char ifname[10]; |
41 |
+ char ifname[18]; |
42 |
struct iflist *itmp = NULL; |
43 |
struct iflist *tail = NULL; |
44 |
unsigned int index = 0; |
45 |
@@ -433,7 +433,7 @@ void ifstats(const struct OPTIONS *options, struct filterstate *ofilter, |
46 |
FILE *logfile = NULL; |
47 |
|
48 |
int br; |
49 |
- char ifname[10]; |
50 |
+ char ifname[18]; |
51 |
|
52 |
int ch; |
53 |
|
54 |
@@ -760,7 +760,7 @@ void detstats(char *iface, const struct OPTIONS *options, int facilitytime, |
55 |
char *tpacket; |
56 |
unsigned int iphlen; |
57 |
|
58 |
- char ifname[10]; |
59 |
+ char ifname[18]; |
60 |
struct sockaddr_ll fromaddr; |
61 |
unsigned short linktype; |
62 |
|
63 |
diff --git a/src/ifstats.h b/src/ifstats.h |
64 |
index 350dd13..abcde1e 100644 |
65 |
--- a/src/ifstats.h |
66 |
+++ b/src/ifstats.h |
67 |
@@ -6,7 +6,7 @@ ifstats.h - structure definitions for interface counts |
68 |
***/ |
69 |
|
70 |
struct iflist { |
71 |
- char ifname[8]; |
72 |
+ char ifname[18]; |
73 |
unsigned int encap; |
74 |
unsigned long long iptotal; |
75 |
unsigned long badtotal; |
76 |
diff --git a/src/itrafmon.c b/src/itrafmon.c |
77 |
index a54dcc2..044bae1 100644 |
78 |
--- a/src/itrafmon.c |
79 |
+++ b/src/itrafmon.c |
80 |
@@ -604,7 +604,7 @@ void ipmon(struct OPTIONS *options, |
81 |
int curwin = 0; |
82 |
|
83 |
int readlen; |
84 |
- char ifname[10]; |
85 |
+ char ifname[18]; |
86 |
|
87 |
unsigned long long total_pkts = 0; |
88 |
|
89 |
diff --git a/src/othptab.h b/src/othptab.h |
90 |
index e412562..ab0d5be 100644 |
91 |
--- a/src/othptab.h |
92 |
+++ b/src/othptab.h |
93 |
@@ -42,7 +42,7 @@ struct othptabent { |
94 |
int s_fstat; |
95 |
int d_fstat; |
96 |
unsigned int protocol; |
97 |
- char iface[8]; |
98 |
+ char iface[18]; |
99 |
unsigned int pkt_length; |
100 |
|
101 |
union { |
102 |
diff --git a/src/promisc.c b/src/promisc.c |
103 |
index c3ed691..d126243 100644 |
104 |
--- a/src/promisc.c |
105 |
+++ b/src/promisc.c |
106 |
@@ -49,7 +49,7 @@ void init_promisc_list(struct promisc_states **list) |
107 |
{ |
108 |
FILE *fd; |
109 |
int ifd; |
110 |
- char buf[8]; |
111 |
+ char buf[18]; |
112 |
struct promisc_states *ptmp; |
113 |
struct promisc_states *tail = NULL; |
114 |
struct ifreq ifr; |
115 |
@@ -81,6 +81,7 @@ void init_promisc_list(struct promisc_states **list) |
116 |
*/ |
117 |
|
118 |
if ((strncmp(buf, "eth", 3) == 0) || |
119 |
+ (strncmp(buf, "ath", 3) == 0) || |
120 |
(strncmp(buf, "fddi", 4) == 0) || |
121 |
(strncmp(buf, "tr", 2) == 0) || |
122 |
(strncmp(ptmp->params.ifname, "wvlan", 4) == 0) || |
123 |
diff --git a/src/promisc.h b/src/promisc.h |
124 |
index c3f07a1..a06471c 100644 |
125 |
--- a/src/promisc.h |
126 |
+++ b/src/promisc.h |
127 |
@@ -9,7 +9,7 @@ |
128 |
*/ |
129 |
|
130 |
struct promisc_params { |
131 |
- char ifname[8]; |
132 |
+ char ifname[18]; |
133 |
int saved_state; |
134 |
int state_valid; |
135 |
}; |
136 |
diff --git a/src/serv.c b/src/serv.c |
137 |
index c8309ad..f7e7daf 100644 |
138 |
--- a/src/serv.c |
139 |
+++ b/src/serv.c |
140 |
@@ -739,7 +739,7 @@ void servmon(char *ifname, struct porttab *ports, |
141 |
unsigned short linktype; |
142 |
int br; |
143 |
|
144 |
- char iface[8]; |
145 |
+ char iface[18]; |
146 |
unsigned int idx = 1; |
147 |
|
148 |
unsigned int sport = 0; |
149 |
diff --git a/src/tcptable.h b/src/tcptable.h |
150 |
index 3e17793..c029c73 100644 |
151 |
--- a/src/tcptable.h |
152 |
+++ b/src/tcptable.h |
153 |
@@ -64,7 +64,7 @@ struct tcptableent { |
154 |
unsigned long finack; |
155 |
int partial; |
156 |
int finsent; |
157 |
- char ifname[8]; |
158 |
+ char ifname[18]; |
159 |
unsigned int index; |
160 |
int reused; |
161 |
int timedout; |