1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00
freebsd-ports/net/mopd/files/patch-pf.c
David E. O'Brien 8f7ba5aeb3 String paranoia and security fixes from OpenBSD: prevent a remote buffer
overflow and remote syslog() exploits.

Obtained from:	OpenBSD
2000-08-29 00:49:08 +00:00

23 lines
633 B
C

--- 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);