From 55e983e5a1444f1768176774461316bec7952268 Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Fri, 1 Nov 2024 15:24:15 -0500 Subject: [PATCH] Fixed stack-use-after-return bug found with -fsanitize --- oscar64/oscar64.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oscar64/oscar64.cpp b/oscar64/oscar64.cpp index a6a9537..85dcbac 100644 --- a/oscar64/oscar64.cpp +++ b/oscar64/oscar64.cpp @@ -553,8 +553,8 @@ int main2(int argc, const char** argv) strftime(dstring, sizeof(tstring) - 1, "\"%b %d %Y\"", &t); strftime(tstring, sizeof(dstring) - 1, "\"%H:%M:%S\"", &t); - compiler->AddDefine(Ident::Unique("__DATE__"), dstring); - compiler->AddDefine(Ident::Unique("__TIME__"), tstring); + compiler->AddDefine(Ident::Unique("__DATE__"), _strdup(dstring)); + compiler->AddDefine(Ident::Unique("__TIME__"), _strdup(tstring)); } // Add runtime module