From eb940e0a21ec37e0a5cbc2c7191fbe7f04695cec Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Tue, 30 Nov 2021 03:44:38 -0800 Subject: [PATCH] Fix paranoia guard in literal string alloc --- str.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/str.c b/str.c index b692392..9d25028 100644 --- a/str.c +++ b/str.c @@ -316,7 +316,7 @@ addliteral(char *str) math_error("Cannot allocate large literal string"); /*NOTREACHED*/ } - table[len] = '\0'; /* guard paranoia */ + newstr[len] = '\0'; /* guard paranoia */ strlcpy(newstr, str, len); table[literals.l_count++] = newstr; return newstr;