From bdcbf61fb2a99486907d6575e4990939f86e3dca Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Mon, 2 Dec 2024 16:48:15 -0500 Subject: [PATCH 1/3] Copy into fix Buffer size issue --- display/d.histogram/pie.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/display/d.histogram/pie.c b/display/d.histogram/pie.c index 9183f8ca736..76a3b3b6572 100644 --- a/display/d.histogram/pie.c +++ b/display/d.histogram/pie.c @@ -29,7 +29,7 @@ */ #include - +#include #include #include @@ -123,7 +123,10 @@ int pie(struct stat_list *dist_stats, /* list of distribution statistics */ i++; tic_every = tics[i].every; tic_unit = tics[i].unit; - strcpy(tic_name, tics[i].name); + if (G_strlcpy(tic_name, tics[i].name, sizeof(tic_name)) >= + sizeof(tic_name)) { + G_fatal_error(_("Tic name <%s> is too long"), tics[i].name); + } } else { if (is_fp && !cat_ranges) { From 7863b43863d25a19a4f757304675d1dc066a7d7c Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Mon, 2 Dec 2024 17:18:15 -0500 Subject: [PATCH 2/3] update with glocale --- display/d.histogram/pie.c | 1 + 1 file changed, 1 insertion(+) diff --git a/display/d.histogram/pie.c b/display/d.histogram/pie.c index 76a3b3b6572..5797dabc809 100644 --- a/display/d.histogram/pie.c +++ b/display/d.histogram/pie.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "pie.h" From 5880fd8fd895292da36a64beeb2c5e3786204bbd Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Wed, 4 Dec 2024 13:39:40 -0500 Subject: [PATCH 3/3] rearrange headers --- display/d.histogram/pie.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/display/d.histogram/pie.c b/display/d.histogram/pie.c index 5797dabc809..9657312aec8 100644 --- a/display/d.histogram/pie.c +++ b/display/d.histogram/pie.c @@ -29,10 +29,11 @@ */ #include -#include -#include + #include +#include #include +#include #include "pie.h"