[fdo-commits] r2681 - in trunk: Fdo/Unmanaged/Src/Fdo/Xml Utilities/OWS/Src

svn_fdo at osgeo.org svn_fdo at osgeo.org
Mon Mar 12 15:26:13 EDT 2007


Author: jacklee
Date: 2007-03-12 15:26:12 -0400 (Mon, 12 Mar 2007)
New Revision: 2681

Modified:
   trunk/Fdo/Unmanaged/Src/Fdo/Xml/CoordinateGroup.cpp
   trunk/Utilities/OWS/Src/FdoOwsHttpHandler.cpp
Log:
Ticket #38

Fixed a couple of memory related problems

1) In FdoXmlCoordinateGroup::~FdoXmlCoordinateGroup 
delete m_doubleArray;
should be
delete[] m_doubleArray;

2) In FdoOwsHttpHandler::_headerCallback, retCodeStr was not nul terminated.

Modified: trunk/Fdo/Unmanaged/Src/Fdo/Xml/CoordinateGroup.cpp
===================================================================
--- trunk/Fdo/Unmanaged/Src/Fdo/Xml/CoordinateGroup.cpp	2007-03-12 17:59:39 UTC (rev 2680)
+++ trunk/Fdo/Unmanaged/Src/Fdo/Xml/CoordinateGroup.cpp	2007-03-12 19:26:12 UTC (rev 2681)
@@ -25,7 +25,7 @@
 FdoXmlCoordinateGroup::~FdoXmlCoordinateGroup()
 {
 	if(m_doubleArray != NULL)
-		delete m_doubleArray;
+		delete[] m_doubleArray;
 }
 
 

Modified: trunk/Utilities/OWS/Src/FdoOwsHttpHandler.cpp
===================================================================
--- trunk/Utilities/OWS/Src/FdoOwsHttpHandler.cpp	2007-03-12 17:59:39 UTC (rev 2680)
+++ trunk/Utilities/OWS/Src/FdoOwsHttpHandler.cpp	2007-03-12 19:26:12 UTC (rev 2681)
@@ -103,10 +103,11 @@
         if (len > FdoOwsGlobals::MIN_LEN_HTTP_RESPONSE_FIRST_LINE && 
             strncmp((const char*)ptr, FdoOwsGlobals::HTTP_SLASH, sizeof(FdoOwsGlobals::HTTP_SLASH) - 1) == 0)
         {
-            char retCodeStr[FdoOwsGlobals::LEN_HTTP_RET_CODE];
+            char retCodeStr[FdoOwsGlobals::LEN_HTTP_RET_CODE+1];
             strncpy(retCodeStr, 
                 (const char*)ptr + FdoOwsGlobals::MIN_LEN_HTTP_RESPONSE_FIRST_LINE - FdoOwsGlobals::LEN_HTTP_RET_CODE, 
                 FdoOwsGlobals::LEN_HTTP_RET_CODE);
+            retCodeStr[FdoOwsGlobals::LEN_HTTP_RET_CODE] = '\0';
             int retCode = atoi(retCodeStr);
             if (retCode < FdoOwsGlobals::MIN_HTTP_ERROR_CODE)
                 m_bValidDocument = true;



More information about the fdo-commits mailing list