[mapserver-commits] r10209 - in trunk/mapserver: . mapscript/php

svn at osgeo.org svn at osgeo.org
Mon Jun 7 13:43:48 EDT 2010


Author: aboudreault
Date: 2010-06-07 13:43:46 -0400 (Mon, 07 Jun 2010)
New Revision: 10209

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapscript/php/layer.c
   trunk/mapserver/mapscript/php/map.c
   trunk/mapserver/maptemplate.c
Log:
Fixed MapScript processTemplate and processQueryTemplate seg fault (#3468)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2010-06-07 14:32:43 UTC (rev 10208)
+++ trunk/mapserver/HISTORY.TXT	2010-06-07 17:43:46 UTC (rev 10209)
@@ -14,6 +14,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Fixed MapScript processTemplate and processQueryTemplate seg fault (#3468)
+
 - Fixed shapeObj->toWkt() returns single point for multipoint geometry (#2762)
 
 - Fixed Internal server error when Oracle returns ora-28002 code (#3457)

Modified: trunk/mapserver/mapscript/php/layer.c
===================================================================
--- trunk/mapserver/mapscript/php/layer.c	2010-06-07 14:32:43 UTC (rev 10208)
+++ trunk/mapserver/mapscript/php/layer.c	2010-06-07 17:43:46 UTC (rev 10209)
@@ -1554,7 +1554,7 @@
     else
     {
         mapscript_report_mapserver_error(E_WARNING TSRMLS_CC);
-        RETURN_STRING("", 0);
+        RETURN_STRING("", 1);
     }
 }
 /* }}} */

Modified: trunk/mapserver/mapscript/php/map.c
===================================================================
--- trunk/mapserver/mapscript/php/map.c	2010-06-07 14:32:43 UTC (rev 10208)
+++ trunk/mapserver/mapscript/php/map.c	2010-06-07 17:43:46 UTC (rev 10209)
@@ -2602,7 +2602,7 @@
     {
         // Failed for some reason
         mapscript_report_php_error(E_WARNING, "processTemplate: failed reading array" TSRMLS_CC);
-        RETURN_STRING("", 0);
+        RETURN_STRING("", 1);
     }
     efree(papszNameValue);
 
@@ -2620,7 +2620,7 @@
     else
     {
         mapscript_report_mapserver_error(E_WARNING TSRMLS_CC);
-        RETURN_STRING("", 0);
+        RETURN_STRING("", 1);
     }
 }
 /* }}} */
@@ -2682,7 +2682,7 @@
     {
         // Failed for some reason
         mapscript_report_php_error(E_WARNING, "processQueryTemplate: failed reading array" TSRMLS_CC);
-        RETURN_STRING("", 0);
+        RETURN_STRING("", 1);
     }
     efree(papszNameValue);
 
@@ -2701,7 +2701,7 @@
     else
     {
         mapscript_report_mapserver_error(E_WARNING TSRMLS_CC);
-        RETURN_STRING("", 0);
+        RETURN_STRING("", 1);
     }
 }
 /* }}} */
@@ -2762,7 +2762,7 @@
     {
         // Failed for some reason
         mapscript_report_php_error(E_WARNING, "processLegendTemplate: failed reading array" TSRMLS_CC);
-        RETURN_STRING("", 0);
+        RETURN_STRING("", 1);
     }
     efree(papszNameValue);
 
@@ -2781,7 +2781,7 @@
     else
     {
         mapscript_report_mapserver_error(E_WARNING TSRMLS_CC);
-        RETURN_STRING("", 0);
+        RETURN_STRING("", 1);
     }
 }
 /* }}} */
@@ -3062,7 +3062,7 @@
     else
     {
         mapscript_report_mapserver_error(E_WARNING TSRMLS_CC);
-        RETURN_STRING("", 0);
+        RETURN_STRING("", 1);
     }
 }
 /* }}} */

Modified: trunk/mapserver/maptemplate.c
===================================================================
--- trunk/mapserver/maptemplate.c	2010-06-07 14:32:43 UTC (rev 10208)
+++ trunk/mapserver/maptemplate.c	2010-06-07 17:43:46 UTC (rev 10209)
@@ -3863,6 +3863,11 @@
   ms_regex_t re; /* compiled regular expression to be matched */ 
   char szPath[MS_MAXPATHLEN];
 
+  if(!html) {
+    msSetError(MS_WEBERR, "No template specified", "msReturnPage()");
+    return MS_FAILURE;
+  }
+
   if(ms_regcomp(&re, MS_TEMPLATE_EXPR, MS_REG_EXTENDED|MS_REG_NOSUB) != 0) {
     msSetError(MS_REGEXERR, NULL, "msReturnPage()");
     return MS_FAILURE;
@@ -4405,8 +4410,8 @@
     ** TODO : use web minscaledenom/maxscaledenom depending on the scale.
     */
     if(msReturnPage(mapserv, mapserv->map->web.template, BROWSE, &pszBuffer) != MS_SUCCESS) {
-      msFree(pszBuffer);
-      pszBuffer = NULL;
+        msFree(pszBuffer);
+        pszBuffer = NULL;
     }
 
     /* Don't free the map and names and values arrays since they were passed by reference. */



More information about the mapserver-commits mailing list