]> git.ipfire.org Git - people/pmueller/ipfire-3.x.git/blob - pkgs/net-tools/patches/net-tools-1.60-overflow.patch
Change file layout of the makefiles.
[people/pmueller/ipfire-3.x.git] / pkgs / net-tools / patches / net-tools-1.60-overflow.patch
1 diff -up net-tools-1.60/netstat.c.overflow net-tools-1.60/netstat.c
2 --- net-tools-1.60/netstat.c.overflow 2010-01-02 10:45:45.000000000 +0100
3 +++ net-tools-1.60/netstat.c 2010-01-02 10:50:50.000000000 +0100
4 @@ -777,7 +777,7 @@ static void tcp_do_one(int lnr, const ch
5 local_addr[22 - strlen(buffer)] = '\0';
6
7 strcat(local_addr, ":");
8 - strcat(local_addr, buffer);
9 + strncat(local_addr, buffer, sizeof(local_addr)-strlen(local_addr)-1);
10 snprintf(buffer, sizeof(buffer), "%s",
11 get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT));
12
13 @@ -785,7 +785,7 @@ static void tcp_do_one(int lnr, const ch
14 rem_addr[22 - strlen(buffer)] = '\0';
15
16 strcat(rem_addr, ":");
17 - strcat(rem_addr, buffer);
18 + strncat(rem_addr, buffer, sizeof(rem_addr)-strlen(rem_addr)-1);
19 timers[0] = '\0';
20
21 if (flag_opt)
22 @@ -926,7 +926,7 @@ static void udp_do_one(int lnr, const ch
23 if ((strlen(local_addr) + strlen(buffer)) > 22)
24 local_addr[22 - strlen(buffer)] = '\0';
25 strcat(local_addr, ":");
26 - strcat(local_addr, buffer);
27 + strncat(local_addr, buffer, sizeof(local_addr)-strlen(local_addr)-1);
28
29 snprintf(buffer, sizeof(buffer), "%s",
30 get_sname(htons(rem_port), "udp", flag_not & FLAG_NUM_PORT));
31 @@ -935,7 +935,7 @@ static void udp_do_one(int lnr, const ch
32 if ((strlen(rem_addr) + strlen(buffer)) > 22)
33 rem_addr[22 - strlen(buffer)] = '\0';
34 strcat(rem_addr, ":");
35 - strcat(rem_addr, buffer);
36 + strncat(rem_addr, buffer, sizeof(rem_addr)-strlen(rem_addr)-1);
37
38 timers[0] = '\0';
39 if (flag_opt)
40 @@ -1045,7 +1045,7 @@ static void raw_do_one(int lnr, const ch
41 if ((strlen(local_addr) + strlen(buffer)) > 22)
42 local_addr[22 - strlen(buffer)] = '\0';
43 strcat(local_addr, ":");
44 - strcat(local_addr, buffer);
45 + strncat(local_addr, buffer, sizeof(local_addr)-strlen(local_addr)-1);
46
47 snprintf(buffer, sizeof(buffer), "%s",
48 get_sname(htons(rem_port), "raw", flag_not & FLAG_NUM_PORT));
49 @@ -1054,7 +1054,7 @@ static void raw_do_one(int lnr, const ch
50 if ((strlen(rem_addr) + strlen(buffer)) > 22)
51 rem_addr[22 - strlen(buffer)] = '\0';
52 strcat(rem_addr, ":");
53 - strcat(rem_addr, buffer);
54 + strncat(rem_addr, buffer, sizeof(rem_addr)-strlen(rem_addr)-1);
55
56 timers[0] = '\0';
57 if (flag_opt)