From 1754ff2a107bcd1de53d4627c9ee50bd5ce1c76a Mon Sep 17 00:00:00 2001 From: Mike FABIAN Date: Sat, 21 Sep 2024 21:25:32 +0200 Subject: [PATCH] ICU-22909 Fix coverity warning in makeconv.cpp See: https://unicode-org.atlassian.net/browse/ICU-22909 --- icu4c/source/tools/makeconv/makeconv.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/icu4c/source/tools/makeconv/makeconv.cpp b/icu4c/source/tools/makeconv/makeconv.cpp index a920069ed3ff..2156248eaf30 100644 --- a/icu4c/source/tools/makeconv/makeconv.cpp +++ b/icu4c/source/tools/makeconv/makeconv.cpp @@ -377,6 +377,10 @@ int main(int argc, char* argv[]) data.staticData.name); } + if (strlen(cnvName) + 1 > UPRV_LENGTHOF(data.staticData.name)) { + fprintf(stderr, "converter name %s too long\n", cnvName); + return U_BUFFER_OVERFLOW_ERROR; + } uprv_strcpy((char*)data.staticData.name, cnvName); if(!uprv_isInvariantString((char*)data.staticData.name, -1)) {