Module Name: src Committed By: christos Date: Thu Oct 3 17:08:27 UTC 2019
Modified Files: src/lib/libskey: put.c Log Message: use strlcpy here; the destination string is passed to strtok_r, and if it is not NUL terminated, bad things can happen. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/lib/libskey/put.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libskey/put.c diff -u src/lib/libskey/put.c:1.13 src/lib/libskey/put.c:1.14 --- src/lib/libskey/put.c:1.13 Fri Feb 4 11:14:55 2005 +++ src/lib/libskey/put.c Thu Oct 3 13:08:26 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: put.c,v 1.13 2005/02/04 16:14:55 perry Exp $ */ +/* $NetBSD: put.c,v 1.14 2019/10/03 17:08:26 christos Exp $ */ /* S/KEY v1.1b (put.c) * @@ -12,7 +12,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: put.c,v 1.13 2005/02/04 16:14:55 perry Exp $"); +__RCSID("$NetBSD: put.c,v 1.14 2019/10/03 17:08:26 christos Exp $"); #include <stdio.h> #include <string.h> @@ -2129,7 +2129,7 @@ int etob(char *out, const char *e) if (e == NULL) return -1; - strncpy (input, e, sizeof (input)); + strlcpy (input, e, sizeof (input)); memset (b, 0, sizeof (b)); memset (out, 0, 8); for (i = 0, p = 0; i < 6; i++, p += 11)