From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- .../nttcp/files/nttcp-1.47-format-security.patch | 132 +++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 net-analyzer/nttcp/files/nttcp-1.47-format-security.patch (limited to 'net-analyzer/nttcp/files') diff --git a/net-analyzer/nttcp/files/nttcp-1.47-format-security.patch b/net-analyzer/nttcp/files/nttcp-1.47-format-security.patch new file mode 100644 index 000000000000..514b5fa6e33b --- /dev/null +++ b/net-analyzer/nttcp/files/nttcp-1.47-format-security.patch @@ -0,0 +1,132 @@ +--- a/nttcp.c ++++ b/nttcp.c +@@ -372,7 +372,7 @@ + #define Message(x) fMessage(stdout, x) + + void Exit(char *s, int ret) { +- syslog(LOG_DEBUG, s); ++ syslog(LOG_DEBUG, "%s\n", s); + fMessage(stderr,s); + exit(ret); + } +@@ -694,7 +694,7 @@ + register int cnt; + if (opt.udp) { + struct sockaddr_in from; +- int len= sizeof(from); ++ socklen_t len= sizeof(from); + cnt= recvfrom(fd, buf, count, 0, (struct sockaddr *)&from, &len); + SysCalls++; + } +@@ -1150,8 +1150,8 @@ + int main(int argc, char *argv[]) { + + struct sockaddr_in PeerAddr; +- int PeerAddrLeng; +- char *DataPortFormat= "dataport: %d\n"; ++ socklen_t PeerAddrLeng; ++ const char DataPortFormat[]= "dataport: %d\n"; + int DataPort; + struct sockaddr_in sinlh; /* for control socket on local host */ + int fd; /* data socket to transport the data */ +@@ -1184,7 +1184,8 @@ + } + if (opt.inetd) { + /* we simulate inetd behaviour */ +- int nsrv, srv, fromleng; ++ int nsrv, srv; ++ socklen_t fromleng; + struct sockaddr_in sinsrv; + struct sockaddr_in frominet; + if (opt.Verbose) { +@@ -1285,7 +1286,7 @@ + Exit(MsgBuf, 2); + } + if (OptionLine[sizeof(OptionLine)-1] != '\0') { +- sprintf(MsgBuf, "%s: optionline longer than %d\n", ++ sprintf(MsgBuf, "%s: optionline longer than %zd\n", + myname, sizeof(OptionLine)-1); + Exit(MsgBuf, 3); + } +@@ -1308,7 +1309,7 @@ + Peer[PeerCount].fin= stdin; + Peer[PeerCount].fout= stdout; + syslog(LOG_DEBUG, +- "call from %.50 (=%.30s): done remote initial processing\n", ++ "call from %.50s (=%.30s): done remote initial processing\n", + Peer[PeerCount].HostName, Peer[PeerCount].IPName); + PeerCount++; + } +@@ -1617,7 +1618,7 @@ + sinlh.sin_family = AF_INET; + #if defined(MULTICAST) + if (opt.MulticastChannel) { +- int ml, p, join_group; ++ int p, join_group; + struct ip_mreq mreq; + sinlh.sin_port = htons(opt.MulticastPort); + if (bind(fd, (struct sockaddr *)&sinlh, sizeof(sinlh)) < 0) { +@@ -1640,7 +1641,6 @@ + sprintf(MsgBuf, DataPortFormat, DEFAULT_PORT); + + /* tell it our clients */ +- ml= strlen(MsgBuf); + for (p=0; p