Skip to content

Commit

Permalink
ICU-22909 Fix coverity warning in makeconv.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-fabian authored and markusicu committed Sep 24, 2024
1 parent 687ed05 commit 1754ff2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions icu4c/source/tools/makeconv/makeconv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 1754ff2

Please sign in to comment.