Skip to content

Commit

Permalink
i.rectify: Fix copy into fixed size buffer issue in main.c of i.recti…
Browse files Browse the repository at this point in the history
…fy module (#4299)

* Copy into fix size buffer issue

* removed variable Len

* Update imagery/i.rectify/main.c

Co-authored-by: Nicklas Larsson <n_larsson@yahoo.com>

---------

Co-authored-by: Shubham Vasudeo Desai <sdesai8@vclvm178-100.vcl.ncsu.edu>
Co-authored-by: Shubham Vasudeo Desai <sdesai8@vclvm177-82.vcl.ncsu.edu>
Co-authored-by: Nicklas Larsson <n_larsson@yahoo.com>
  • Loading branch information
4 people committed Sep 16, 2024
1 parent c840f3c commit 95c123d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions imagery/i.rectify/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <string.h>
#include "global.h"

#include <grass/gis.h>

int seg_mb_img;

func interpolate;
Expand Down Expand Up @@ -151,8 +153,14 @@ int main(int argc, char *argv[])
interpolate = menu[method].method;

G_strip(grp->answer);
strcpy(group.name, grp->answer);
strcpy(extension, ext->answer);
if (G_strlcpy(group.name, grp->answer, sizeof(group.name)) >=
sizeof(group.name)) {
G_fatal_error(_("Group name <%s> is too long"), grp->answer);
}
if (G_strlcpy(extension, ext->answer, sizeof(extension)) >=
sizeof(extension)) {
G_fatal_error(_("Extension <%s> is too long"), ext->answer);
}
order = atoi(val->answer);

seg_mb = NULL;
Expand Down

0 comments on commit 95c123d

Please sign in to comment.