From b891f80b104ffa71e6ddcf6721e2af7a8a4f74ab Mon Sep 17 00:00:00 2001 From: deraadt Date: Sat, 12 Apr 1997 16:37:37 +0000 Subject: [PATCH] botched strncpy, adam@math.tau.ac.il --- usr.sbin/ypserv/ypxfr/ypxfr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/ypserv/ypxfr/ypxfr.c b/usr.sbin/ypserv/ypxfr/ypxfr.c index fda6dbf27ad..bd2ca255598 100644 --- a/usr.sbin/ypserv/ypxfr/ypxfr.c +++ b/usr.sbin/ypserv/ypxfr/ypxfr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypxfr.c,v 1.16 1997/04/12 00:12:58 deraadt Exp $ */ +/* $OpenBSD: ypxfr.c,v 1.17 1997/04/12 16:37:37 deraadt Exp $ */ /* * Copyright (c) 1994 Mats O Jansson @@ -32,7 +32,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: ypxfr.c,v 1.16 1997/04/12 00:12:58 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: ypxfr.c,v 1.17 1997/04/12 16:37:37 deraadt Exp $"; #endif #include @@ -148,8 +148,8 @@ u_long *lordernum; if (v.dptr == NULL) { *lordernum = 0; } else { - strncpy(order, v.dptr, v.dsize); - order[v.dsize] = '\0'; + strncpy(order, v.dptr, sizeof order-1); + order[sizeof order-1] = '\0'; *lordernum = (u_long) atol((char *) &order); } } -- 2.20.1