From 54d23de51656df3f41c86816f4ca3b66e9a60425 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Tue, 8 Mar 2016 11:34:15 -0700 Subject: [PATCH] microcode/option.c (string_copy_limited): Null-terminate result. --- src/microcode/option.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/microcode/option.c b/src/microcode/option.c index 7cee60bef..021f6ba80 100644 --- a/src/microcode/option.c +++ b/src/microcode/option.c @@ -302,6 +302,7 @@ string_copy_limited (const char * s, const char * e) unsigned int n_chars = (e - s); char * result = (OS_malloc (n_chars + 1)); strncpy (result, s, n_chars); + result[n_chars] = '\0'; return (result); } -- 2.25.1