Skip to content

Commit

Permalink
ICU-22912 fix coverity warning in gencnval.c
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-fabian committed Sep 22, 2024
1 parent 2f348f4 commit 941819b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions icu4c/source/tools/gencnval/gencnval.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ main(int argc, char* argv[]) {

const char* sourcedir = options[SOURCEDIR].value;
if (sourcedir != NULL && *sourcedir != 0) {
if (strlen(sourcedir) + strlen(path) + 1 >= 512) {
fprintf(stderr,
"Length of sourcedir + path is too long, must be <= 510.\n");
exit(U_ILLEGAL_ARGUMENT_ERROR);
}
char *end;
uprv_strcpy(pathBuf, sourcedir);
end = uprv_strchr(pathBuf, 0);
Expand Down

0 comments on commit 941819b

Please sign in to comment.