diff options
author | mestre <mestre@openbsd.org> | 2016-03-16 20:15:15 +0000 |
---|---|---|
committer | mestre <mestre@openbsd.org> | 2016-03-16 20:15:15 +0000 |
commit | 3c0f1992114b9b282604d6055d568616a5d80575 (patch) | |
tree | 445e189604b188b351cbdc617573fdecfe547131 /usr.sbin/inetd | |
parent | Replace atoi(3) calls for safer strtonum(3) (diff) | |
download | wireguard-openbsd-3c0f1992114b9b282604d6055d568616a5d80575.tar.xz wireguard-openbsd-3c0f1992114b9b282604d6055d568616a5d80575.zip |
Replace strncpy(3) calls for safer strlcpy(3)
OK deraadt@ jca@
Diffstat (limited to 'usr.sbin/inetd')
-rw-r--r-- | usr.sbin/inetd/inetd.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index 08f5b0ae006..ed6aee90991 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inetd.c,v 1.151 2016/03/16 20:09:58 mestre Exp $ */ +/* $OpenBSD: inetd.c,v 1.152 2016/03/16 20:15:15 mestre Exp $ */ /* * Copyright (c) 1983,1991 The Regents of the University of California. @@ -646,9 +646,8 @@ config(int sig, short event, void *arg) 1, USHRT_MAX, NULL)); if (!port) { - /* XXX */ - strncpy(protoname, sep->se_proto, - sizeof(protoname)); + (void)strlcpy(protoname, sep->se_proto, + sizeof(protoname)); if (isdigit((unsigned char) protoname[strlen(protoname) - 1])) protoname[strlen(protoname) - 1] = '\0'; @@ -703,9 +702,8 @@ config(int sig, short event, void *arg) 1, USHRT_MAX, NULL)); if (!port) { - /* XXX */ - strncpy(protoname, sep->se_proto, - sizeof(protoname)); + (void)strlcpy(protoname, sep->se_proto, + sizeof(protoname)); if (isdigit((unsigned char) protoname[strlen(protoname) - 1])) protoname[strlen(protoname) - 1] = '\0'; |