Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37756730
en ru br
ALT Linux repos
S:1.60-alt19
5.0: 1.60-alt15
4.1: 1.60-alt13
4.0: 1.60-alt13
3.0: 1.60-alt12

Group :: System/Configuration/Networking
RPM: net-tools

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: net-tools-1.60-alt-bound.patch
Download


diff -ur net-tools-1.60.orig/netstat.c net-tools-1.60/netstat.c
--- net-tools-1.60.orig/netstat.c	2004-04-07 11:47:05.000000000 -0400
+++ net-tools-1.60/netstat.c	2004-04-07 16:47:15.000000000 -0400
@@ -777,7 +777,7 @@
 	    local_addr[22 - strlen(buffer)] = '\0';
 
 	strcat(local_addr, ":");
-	strcat(local_addr, buffer);
+	strncat(local_addr, buffer, sizeof(local_addr) - 1);
 	snprintf(buffer, sizeof(buffer), "%s",
 		 get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT));
 
@@ -785,7 +785,7 @@
 	    rem_addr[22 - strlen(buffer)] = '\0';
 
 	strcat(rem_addr, ":");
-	strcat(rem_addr, buffer);
+	strncat(rem_addr, buffer, sizeof(rem_addr) - 1);
 	timers[0] = '\0';
 
 	if (flag_opt)
@@ -926,7 +926,7 @@
 	if ((strlen(local_addr) + strlen(buffer)) > 22)
 	    local_addr[22 - strlen(buffer)] = '\0';
 	strcat(local_addr, ":");
-	strcat(local_addr, buffer);
+	strncat(local_addr, buffer, sizeof(local_addr) - 1);
 
 	snprintf(buffer, sizeof(buffer), "%s",
 		 get_sname(htons(rem_port), "udp", flag_not & FLAG_NUM_PORT));
@@ -935,7 +935,7 @@
 	if ((strlen(rem_addr) + strlen(buffer)) > 22)
 	    rem_addr[22 - strlen(buffer)] = '\0';
 	strcat(rem_addr, ":");
-	strcat(rem_addr, buffer);
+	strncat(rem_addr, buffer, sizeof(rem_addr) - 1);
 
 	timers[0] = '\0';
 	if (flag_opt)
@@ -1045,7 +1045,7 @@
 	if ((strlen(local_addr) + strlen(buffer)) > 22)
 	    local_addr[22 - strlen(buffer)] = '\0';
 	strcat(local_addr, ":");
-	strcat(local_addr, buffer);
+	strncat(local_addr, buffer, sizeof(local_addr) - 1);
 
 	snprintf(buffer, sizeof(buffer), "%s",
 		 get_sname(htons(rem_port), "raw", flag_not & FLAG_NUM_PORT));
@@ -1054,7 +1054,7 @@
 	if ((strlen(rem_addr) + strlen(buffer)) > 22)
 	    rem_addr[22 - strlen(buffer)] = '\0';
 	strcat(rem_addr, ":");
-	strcat(rem_addr, buffer);
+	strncat(rem_addr, buffer, sizeof(rem_addr) - 1);
 
 	timers[0] = '\0';
 	if (flag_opt)
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin