]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
cppcheck: arrayIndexThenCheck - change the order of the tests in order to avoid a
authorChristophe Jaillet <jailletc36@apache.org>
Mon, 15 Oct 2012 19:53:22 +0000 (19:53 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Mon, 15 Oct 2012 19:53:22 +0000 (19:53 +0000)
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

index d7b01dd665cda734c4d07613cebcb246ad654223..19db1511cb693bc4122ab91914fd0b78a1abdc27 100644 (file)
@@ -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 */
     }