From 04d17b6b1dba10f07c654127cea8c7792a983381 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 22 May 2021 18:43:33 +0200 Subject: [PATCH] shp2img.c: fix Untrusted loop bound (CID 1174460) --- shp2img.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shp2img.c b/shp2img.c index 508ff38e9b..6054ea17ae 100644 --- a/shp2img.c +++ b/shp2img.c @@ -30,7 +30,7 @@ #include "mapserver.h" #include "maptime.h" - +#include "limits.h" int main(int argc, char *argv[]) { @@ -52,6 +52,11 @@ int main(int argc, char *argv[]) for(i=1; i INT_MAX - 1 ) + { + printf("Invalid number of iterations"); + return 1; + } printf("We will draw %d times...\n", iterations); continue; }