/[gentoo-x86]/net-analyzer/packit/files/packit-1.0-overflow.patch
Gentoo

Contents of /net-analyzer/packit/files/packit-1.0-overflow.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon Aug 1 20:12:52 2011 UTC (3 years, 1 month ago) by jer
Branch: MAIN
CVS Tags: HEAD
Fix buffer overflows (bug #337851). Fix MAC address output format.

(Portage version: 2.2.0_alpha49/cvs/Linux x86_64)

1 --- a/src/utils.c
2 +++ b/src/utils.c
3 @@ -137,7 +137,7 @@
4 #endif
5
6 va_start(va, msgp);
7 - vsnprintf(msg, 256, msgp, va);
8 + vsnprintf(msg, 255, msgp, va);
9
10 msg_len = strlen(msg);
11
12 --- a/src/exit.c
13 +++ b/src/exit.c
14 @@ -36,7 +36,7 @@
15 while(1)
16 {
17 fprintf(stderr, "\n\nWould you like to quit? (y/n): ");
18 - fgets(a, 16, stdin);
19 + fgets(a, 2, stdin);
20
21 if(!strncasecmp(a, "Y", 1))
22 break;
23 --- a/src/define_defaults.c
24 +++ b/src/define_defaults.c
25 @@ -36,7 +36,7 @@
26 rand_d_port = (p_mode == M_TRACE) ? 1 : 0;
27 r_timeout = 1;
28 burst_rate = 1;
29 - hwaddr_p[17] = 0;
30 + /* hwaddr_p[18] = 0; */
31 init_type = 1;
32 interval_sec = 1;
33 interval_usec = 0;
34 --- a/src/inject_defs.h
35 +++ b/src/inject_defs.h
36 @@ -132,9 +132,9 @@
37 u_int16_t rand_d_addr;
38
39 u_int8_t *s_addr; /* source ethernet address string */
40 - u_int8_t shw_addr[17];
41 + u_int8_t shw_addr[18];
42 u_int8_t *d_addr; /* destination ethernet address string */
43 - u_int8_t dhw_addr[17];
44 + u_int8_t dhw_addr[18];
45 } ehdr_o;
46
47 struct arphdr_opts
48 @@ -153,8 +153,8 @@
49 u_int8_t *r_eaddr; /* receiver ethernet address */
50 u_int16_t rand_r_eaddr;
51
52 - u_int8_t shw_addr[17];
53 - u_int8_t rhw_addr[17];
54 + u_int8_t shw_addr[18];
55 + u_int8_t rhw_addr[18];
56 } ahdr_o;
57
58 libnet_t *pkt_d;

  ViewVC Help
Powered by ViewVC 1.1.20