From 750d86a4fc04f53024575d65269281ea6c4e450c Mon Sep 17 00:00:00 2001 From: beck <> Date: Wed, 16 Apr 2014 20:36:35 +0000 Subject: Clean up dangerous strncpy use. This included a use where the resulting string was potentially not nul terminated and a place where malloc return was unchecked. while we're at it remove dummytest.c ok miod@ --- src/lib/libcrypto/err/err.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/lib/libcrypto/err/err.c') diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c index ae9a209ad7..f6f9d2c080 100644 --- a/src/lib/libcrypto/err/err.c +++ b/src/lib/libcrypto/err/err.c @@ -603,8 +603,7 @@ static void build_SYS_str_reasons(void) char *src = strerror(i); if (src != NULL) { - strncpy(*dest, src, sizeof *dest); - (*dest)[sizeof *dest - 1] = '\0'; + strlcpy(*dest, src, sizeof *dest); str->string = *dest; } } -- cgit v1.2.3-55-g6feb