From ab86ae0284469a9a941f5b196f9cc99a90305e3a Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 15 Oct 2026 08:20:37 +0800 Subject: fix(codegen): prevent NUM_TO_STR buffer overflow Size REAL buffers for the full fixed-point double range and bound writes with snprintf. Register MinGW CRT aliases for embedded execution. Co-Authored-By: Claude Fable 5.1 --- lib/CodeGen/FunctionGen.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/CodeGen/FunctionGen.cc') diff --git a/lib/CodeGen/FunctionGen.cc b/lib/CodeGen/FunctionGen.cc index 978970a..ca8fa45 100644 --- a/lib/CodeGen/FunctionGen.cc +++ b/lib/CodeGen/FunctionGen.cc @@ -11,7 +11,7 @@ using namespace cps; static bool isReservedRuntimeName(const std::string &Name) { static const char *Reserved[] = { "main", "printf", "scanf", "malloc", "free", "strlen", "memcpy", - "strcpy", "strcat", "toupper", "tolower", "sprintf", "strtol", "strtoll", + "strcpy", "strcat", "toupper", "tolower", "sprintf", "snprintf", "strtol", "strtoll", "strtod", "memset", "exit", "fopen", "fclose", "fgetc", "ungetc", "fputs", "fputc", "realloc", "strcmp", "__cxa_allocate_exception", "__cxa_throw", -- cgit v1.3.1-4-g156e