From 2c6bac2f97963bc0be9f870a6b4bd39bafebd137 Mon Sep 17 00:00:00 2001 From: Burkov Egor Date: Thu, 13 Mar 2025 10:21:15 +0300 Subject: [PATCH] ICU-23075 Add nullptr check for localtime call at writesrc.cpp --- icu4c/source/tools/toolutil/writesrc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icu4c/source/tools/toolutil/writesrc.cpp b/icu4c/source/tools/toolutil/writesrc.cpp index 55c2f277b33..3e055c98033 100644 --- a/icu4c/source/tools/toolutil/writesrc.cpp +++ b/icu4c/source/tools/toolutil/writesrc.cpp @@ -136,7 +136,7 @@ usrc_writeFileNameGeneratedBy( time(&t); lt=localtime(&t); - if(generator==nullptr) { + if(generator==nullptr && lt!=nullptr) { strftime(buffer, sizeof(buffer), "%Y-%m-%d", lt); fprintf(f, pattern, prefix, prefix, filename, prefix, prefix, buffer); } else {