memcpy->strncpy, and avoid copying beyond the static string length

into potentially unmapped regions.
This commit is contained in:
mrg 2019-10-05 23:30:22 +00:00
parent 49e1839354
commit 630723670f
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: eehandlers.c,v 1.18 2013/07/02 11:59:46 joerg Exp $ */
/* $NetBSD: eehandlers.c,v 1.19 2019/10/05 23:30:22 mrg Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -530,7 +530,7 @@ doio(const struct keytabent *ktent, u_char *buf, ssize_t len, int wr)
buf2 = (u_char *)calloc(1, len);
if (buf2 == NULL) {
memcpy(err_str, "memory allocation failed", sizeof err_str);
strncpy(err_str, "memory allocation failed", sizeof err_str);
return (1);
}