From ed02be59ff4129bbc3bd9fbb7545b7b73648be99 Mon Sep 17 00:00:00 2001 From: Mohan Yelugoti Date: Mon, 14 Oct 2024 07:54:32 -0400 Subject: [PATCH] ps.map: initialize variable contents before using them in get_ll_bounds (#4501) In some situations, when some conditionals fails, we would be assigning uninitialized variables to values, which is undefined behavior. Fix that by assigning a value to the variables. This was found using cppcheck tool. Signed-off-by: Mohan Yelugoti --- ps/ps.map/do_geogrid.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ps/ps.map/do_geogrid.c b/ps/ps.map/do_geogrid.c index 0fac5f80cac..c22ef86379c 100644 --- a/ps/ps.map/do_geogrid.c +++ b/ps/ps.map/do_geogrid.c @@ -300,6 +300,7 @@ void get_ll_bounds(double *w, double *e, double *s, double *n) double ew, ns; int first; + east = west = north = south = 0.0; e1 = PS.w.east; w1 = PS.w.west; n1 = PS.w.north;