diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-04-12 16:37:38 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-04-12 16:37:38 +0000 |
commit | b681461ea8514b67e8f293b3651145c0768ea012 (patch) | |
tree | 5e135e9525867c48ed51ff753621872a2c1275e5 /usr.sbin | |
parent | abff10943f9374559ff78f6e852fc14b1eadfc2c (diff) |
botched strncpy, adam@math.tau.ac.il
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ypserv/ypxfr/ypxfr.c | 8 |
1 files 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 <moj@stacken.kth.se> @@ -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 <sys/types.h> @@ -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); } } |