From 499e55458fc4c22cdd0dde37be77cd2bb9c5f36a Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Mon, 15 Oct 2012 19:53:22 +0000 Subject: [PATCH] cppcheck: arrayIndexThenCheck - change the order of the tests in order to avoid a potential out-of-bound access. I think that this module is obsolete, but doing so reduces the noise in cppcheck output... git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1398480 13f79535-47bb-0310-9956-ffa450edef68 --- modules/mappers/mod_imagemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mappers/mod_imagemap.c b/modules/mappers/mod_imagemap.c index d7b01dd665c..19db1511cb6 100644 --- a/modules/mappers/mod_imagemap.c +++ b/modules/mappers/mod_imagemap.c @@ -176,7 +176,7 @@ static int pointinpoly(const double point[2], double pgon[MAXVERTS][2]) int i, numverts, crossings = 0; double x = point[X], y = point[Y]; - for (numverts = 0; pgon[numverts][X] != -1 && numverts < MAXVERTS; + for (numverts = 0; numverts < MAXVERTS && pgon[numverts][X] != -1; numverts++) { /* just counting the vertexes */ } -- 2.47.3