Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/lpr/lpd Fix null terminating the wrong buffer curte...



details:   https://anonhg.NetBSD.org/src/rev/47102d31b643
branches:  trunk
changeset: 479838:47102d31b643
user:      mjl <mjl%NetBSD.org@localhost>
date:      Thu Dec 23 02:10:07 1999 +0000

description:
Fix null terminating the wrong buffer curtesy of similar variables
mixed up. Seemed to never have any ill effect, but then...
Noted by Tetsuya Furukawa in FreeBSD PR/15604.

diffstat:

 usr.sbin/lpr/lpd/lpd.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 1de26236f0df -r 47102d31b643 usr.sbin/lpr/lpd/lpd.c
--- a/usr.sbin/lpr/lpd/lpd.c    Thu Dec 23 01:41:11 1999 +0000
+++ b/usr.sbin/lpr/lpd/lpd.c    Thu Dec 23 02:10:07 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lpd.c,v 1.18 1999/12/07 14:54:46 mrg Exp $     */
+/*     $NetBSD: lpd.c,v 1.19 1999/12/23 02:10:07 mjl Exp $     */
 
 /*
  * Copyright (c) 1983, 1993, 1994
@@ -45,7 +45,7 @@
 #if 0
 static char sccsid[] = "@(#)lpd.c      8.7 (Berkeley) 5/10/95";
 #else
-__RCSID("$NetBSD: lpd.c,v 1.18 1999/12/07 14:54:46 mrg Exp $");
+__RCSID("$NetBSD: lpd.c,v 1.19 1999/12/23 02:10:07 mjl Exp $");
 #endif
 #endif /* not lint */
 
@@ -582,7 +582,7 @@
                        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 */



Home | Main Index | Thread Index | Old Index