Skip to content

Commit

Permalink
v.transform: Fix Copy into fix Buffer size issue (#4415)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShubhamDesai authored Sep 30, 2024
1 parent e02b921 commit 33d0d15
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions vector/v.transform/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,17 @@ int main(int argc, char *argv[])
if (G_parser(argc, argv))
exit(EXIT_FAILURE);

strcpy(Current.name, vold->answer);
strcpy(Trans.name, vnew->answer);
if (G_strlcpy(Current.name, vold->answer, sizeof(Current.name)) >=
sizeof(Current.name)) {
G_fatal_error(_("Input vector map name <%s> is too long"),
vold->answer);
}

if (G_strlcpy(Trans.name, vnew->answer, sizeof(Trans.name)) >=
sizeof(Trans.name)) {
G_fatal_error(_("Output vector map name <%s> is too long"),
vnew->answer);
}

Vect_check_input_output_name(vold->answer, vnew->answer, G_FATAL_EXIT);

Expand Down

0 comments on commit 33d0d15

Please sign in to comment.