[mapserver-commits] r8852 - branches/branch-5-4/mapserver
svn at osgeo.org
svn at osgeo.org
Tue Mar 31 22:58:24 EDT 2009
Author: sdlime
Date: 2009-03-31 22:58:24 -0400 (Tue, 31 Mar 2009)
New Revision: 8852
Modified:
branches/branch-5-4/mapserver/cgiutil.c
Log:
Fixed CONTEN_LENGTH of -1 underflow error. (#2943)
Modified: branches/branch-5-4/mapserver/cgiutil.c
===================================================================
--- branches/branch-5-4/mapserver/cgiutil.c 2009-04-01 02:53:46 UTC (rev 8851)
+++ branches/branch-5-4/mapserver/cgiutil.c 2009-04-01 02:58:24 UTC (rev 8852)
@@ -5,7 +5,7 @@
* Purpose: cgiRequestObj and CGI parameter parsing.
* Author: Steve Lime and the MapServer team.
*
- * Notes: Portions derived from NCSA HTTPd Server's example CGI programs (util.c).
+ * Notes: Portions derived from NCSA HTTPd Server's example CGI programs (util.c).
*
******************************************************************************
* Copyright (c) 1996-2005 Regents of the University of Minnesota.
@@ -44,7 +44,8 @@
static char *readPostBody( cgiRequestObj *request )
{
char *data;
- int data_max, data_len, chunk_size;
+ unsigned int data_max, data_len;
+ int chunk_size;
msIO_needBinaryStdin();
@@ -52,11 +53,11 @@
/* If the length is provided, read in one gulp. */
/* -------------------------------------------------------------------- */
if( getenv("CONTENT_LENGTH") != NULL ) {
- data_max = atoi(getenv("CONTENT_LENGTH"));
+ data_max = (unsigned int) atoi(getenv("CONTENT_LENGTH"));
data = (char *) malloc(data_max+1);
if( data == NULL ) {
msIO_printf("Content-type: text/html%c%c",10,10);
- msIO_printf("malloc() failed, Content-Length: %d unreasonably large?\n", data_max );
+ msIO_printf("malloc() failed, Content-Length: %u unreasonably large?\n", data_max );
exit( 1 );
}
@@ -86,7 +87,7 @@
if( data == NULL ) {
msIO_printf("Content-type: text/html%c%c",10,10);
- msIO_printf("out of memory trying to allocate %d input buffer, POST body too large?\n", data_max+1 );
+ msIO_printf("out of memory trying to allocate %u input buffer, POST body too large?\n", data_max+1 );
exit(1);
}
}
More information about the mapserver-commits
mailing list