From 02191135a0ed33848e004696f0c5a67a997fec61 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Sat, 31 Aug 2019 03:00:26 +0200 Subject: [PATCH] Fix possible unterminated string sym_SetMacroArgID used a `sprintf` that could write no \0. In practice this was benign because %u cannot print 256 chars, but better future-proof this. --- src/asm/symbol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/asm/symbol.c b/src/asm/symbol.c index 50e9f180..ab3b24ad 100644 --- a/src/asm/symbol.c +++ b/src/asm/symbol.c @@ -440,7 +440,7 @@ void sym_SetMacroArgID(uint32_t nMacroCount) { char s[256]; - snprintf(s, sizeof(s), "_%u", nMacroCount); + snprintf(s, sizeof(s) - 1, "_%u", nMacroCount); newmacroargs[MAXMACROARGS] = strdup(s); }