summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2000-01-25 01:51:21 +0000
committerdillon <dillon@FreeBSD.org>2000-01-25 01:51:21 +0000
commitfa7831db8f27874d22fc6062578163cce53bc858 (patch)
treedc1f6a0b49a39fe05e9c040a510251066960f6df /usr.sbin/lpr
parent3a655f20e77c97e02a3904030919f8861063f55d (diff)
downloadFreeBSD-src-fa7831db8f27874d22fc6062578163cce53bc858.zip
FreeBSD-src-fa7831db8f27874d22fc6062578163cce53bc858.tar.gz
Type-o, change from[...] = 0 to fromb[...] = 0. The incorrect buffer
was having its last element zero'd. It turns out not to be a security hole or to have any real effect on the code because 'from' was previously pointing to a buffer of the same size as 'fromb', and the last element in fromb is already 0 anyway due to the use of sizeof(fromb)-1 in the strncpy() call. But I'm not pressing my luck so only the type-o is being fixed.
Diffstat (limited to 'usr.sbin/lpr')
-rw-r--r--usr.sbin/lpr/lpd/lpd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/lpr/lpd/lpd.c b/usr.sbin/lpr/lpd/lpd.c
index f5df2a7..47e8056 100644
--- a/usr.sbin/lpr/lpd/lpd.c
+++ b/usr.sbin/lpr/lpd/lpd.c
@@ -590,7 +590,7 @@ chkhost(f)
inet_ntoa(f->sin_addr));
(void) strncpy(fromb, hp->h_name, sizeof(fromb) - 1);
- from[sizeof(fromb) - 1] = '\0';
+ fromb[sizeof(fromb) - 1] = '\0';
from = fromb;
/* Check for spoof, ala rlogind */
OpenPOWER on IntegriCloud