From 8f7ba5aeb3f7722732f6475b6688ee0e244d863f Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Tue, 29 Aug 2000 00:49:08 +0000 Subject: String paranoia and security fixes from OpenBSD: prevent a remote buffer overflow and remote syslog() exploits. Obtained from: OpenBSD --- net/mopd/files/patch-pf.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 net/mopd/files/patch-pf.c (limited to 'net/mopd/files/patch-pf.c') diff --git a/net/mopd/files/patch-pf.c b/net/mopd/files/patch-pf.c new file mode 100644 index 000000000000..c3efafb1eb00 --- /dev/null +++ b/net/mopd/files/patch-pf.c @@ -0,0 +1,22 @@ +--- common/pf.c 1997/08/18 03:11:31 1.3 ++++ common/pf.c 2000/02/20 17:45:33 1.4 +@@ -176,7 +176,8 @@ + struct ifreq ifr; + int fd; + +- strcpy(ifr.ifr_name, interface); ++ strncpy(ifr.ifr_name, interface,sizeof(ifr.ifr_name) - 1); ++ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = 0; + + ifr.ifr_addr.sa_family = AF_UNSPEC; + bcopy(addr, ifr.ifr_addr.sa_data, 6); +@@ -211,7 +212,8 @@ + struct ifreq ifr; + int fd; + +- strcpy(ifr.ifr_name, interface); ++ strncpy(ifr.ifr_name, interface, sizeof (ifr.ifr_name) - 1); ++ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = 0; + + ifr.ifr_addr.sa_family = AF_UNSPEC; + bcopy(addr, ifr.ifr_addr.sa_data, 6); -- cgit v1.2.3