[mapserver-commits] r9127 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Jun 29 09:42:46 EDT 2009


Author: sdlime
Date: 2009-06-29 09:42:46 -0400 (Mon, 29 Jun 2009)
New Revision: 9127

Modified:
   trunk/mapserver/cgiutil.c
Log:
Added test to confirm Content-Length > 0. (#2943)

Modified: trunk/mapserver/cgiutil.c
===================================================================
--- trunk/mapserver/cgiutil.c	2009-06-29 13:40:16 UTC (rev 9126)
+++ trunk/mapserver/cgiutil.c	2009-06-29 13:42:46 UTC (rev 9127)
@@ -54,6 +54,11 @@
   /* -------------------------------------------------------------------- */
   if( getenv("CONTENT_LENGTH") != NULL ) {
     data_max = (unsigned int) atoi(getenv("CONTENT_LENGTH"));
+    if(data_max <= 0) {
+      msIO_printf("Content-type: text/html%c%c",10,10);
+      msIO_printf("Content-Length too small.\n");
+      exit( 1 );
+    }
     data = (char *) malloc(data_max+1);
     if( data == NULL ) {
       msIO_printf("Content-type: text/html%c%c",10,10);



More information about the mapserver-commits mailing list