[mapserver-commits] r10482 - branches/branch-5-6/mapserver

svn at osgeo.org svn at osgeo.org
Fri Aug 27 00:08:04 EDT 2010


Author: sdlime
Date: 2010-08-27 04:08:04 +0000 (Fri, 27 Aug 2010)
New Revision: 10482

Modified:
   branches/branch-5-6/mapserver/mapserv.c
Log:
Make sure imgsize and mapsize CGI param values are greater than 0 (loosely related to #3524).

Modified: branches/branch-5-6/mapserver/mapserv.c
===================================================================
--- branches/branch-5-6/mapserver/mapserv.c	2010-08-27 04:05:17 UTC (rev 10481)
+++ branches/branch-5-6/mapserver/mapserv.c	2010-08-27 04:08:04 UTC (rev 10482)
@@ -750,7 +750,7 @@
 
       msFreeCharArray(tokens, 2);
       
-      if(mapserv->ImgCols > mapserv->map->maxsize || mapserv->ImgRows > mapserv->map->maxsize || mapserv->ImgCols < 0 || mapserv->ImgRows < 0) {
+      if(mapserv->ImgCols > mapserv->map->maxsize || mapserv->ImgRows > mapserv->map->maxsize || mapserv->ImgCols <= 0 || mapserv->ImgRows <= 0) {
         msSetError(MS_WEBERR, "Image size out of range.", "loadForm()");
         writeError();
       }
@@ -776,7 +776,7 @@
 
       msFreeCharArray(tokens, 2);
       
-      if(mapserv->map->width > mapserv->map->maxsize || mapserv->map->height > mapserv->map->maxsize || mapserv->map->width < 0 || mapserv->map->height < 0) {
+      if(mapserv->map->width > mapserv->map->maxsize || mapserv->map->height > mapserv->map->maxsize || mapserv->map->width <= 0 || mapserv->map->height <= 0) {
         msSetError(MS_WEBERR, "Image size out of range.", "loadForm()");
         writeError();
       }



More information about the mapserver-commits mailing list