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 authored and markusicu committed Sep 25, 2024
1 parent 8ce61b1 commit 67b5763
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions icu4c/source/tools/gencnval/gencnval.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ main(int argc, char* argv[]) {

const char* sourcedir = options[SOURCEDIR].value;
if (sourcedir != NULL && *sourcedir != 0) {
if (strlen(sourcedir) + strlen(path) + 2 > sizeof(pathBuf)) {
fprintf(stderr,
"The source file name is too long, it must be less than %d in bytes.\n",
(int) sizeof(pathBuf) - 1);
exit(U_ILLEGAL_ARGUMENT_ERROR);
}
char *end;
uprv_strcpy(pathBuf, sourcedir);
end = uprv_strchr(pathBuf, 0);
Expand Down

0 comments on commit 67b5763

Please sign in to comment.