New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Denials of service with SLD parameter in WMS requests #4703

Closed
wants to merge 7 commits into
base: master
from
Next

fix denial of service in msApplySLD() (#4703)

  • Loading branch information...
tbonfort committed Jul 27, 2013
commit 08ac5913bcd63fbb1d7b59e63c8f1734b9d18fb2
View
@@ -126,6 +126,7 @@ option(WITH_GDAL "Choose if GDAL input raster support should be built in" ON)
option(WITH_OGR "Choose if OGR/GDAL input vector support should be built in" ON)
option(WITH_CLIENT_WMS "Enable Client WMS Layer support (requires CURL and GDAL support)" OFF)
option(WITH_CLIENT_WFS "Enable Client WMS Layer support (requires CURL and OGR support)" OFF)
option(WITH_CURL "Enable Curl HTTP support (required for wms/wfs client, and remote SLD)" OFF)
option(WITH_WFS "Enable WFS Server support (requires PROJ and OGR support)" ON)
option(WITH_WCS "Enable WCS Server support (requires PROJ and GDAL support)" ON)
option(WITH_LIBXML2 "Choose if libxml2 support should be built in (used for sos, wcs 1.1,2.0 and wfs 1.1)" ON)
@@ -543,19 +544,29 @@ if(WITH_OGR)
endif(WITH_OGR)
if((WITH_CLIENT_WMS) OR (WITH_CLIENT_WFS))
set(WITH_CURL 1)
endif((WITH_CLIENT_WMS) OR (WITH_CLIENT_WFS))
if(WITH_CURL)
find_package(CURL)
if(CURL_FOUND)
include_directories(${CURL_INCLUDE_DIR})
ms_link_libraries( ${CURL_LIBRARY})
set(USE_CURL 1)
else(CURL_FOUND)
report_optional_not_found(CURL)
endif(CURL_FOUND)
endif(WITH_CURL)
if((WITH_CLIENT_WMS) OR (WITH_CLIENT_WFS))
if(USE_CURL)
if(WITH_CLIENT_WFS)
report_dependency_error(CLIENT_WFS CURL)
endif(WITH_CLIENT_WFS)
if(WITH_CLIENT_WMS)
report_dependency_error(CLIENT_WMS CURL)
endif(WITH_CLIENT_WMS)
endif(CURL_FOUND)
endif(USE_CURL)
endif((WITH_CLIENT_WMS) OR (WITH_CLIENT_WFS))
if(WITH_CLIENT_WMS)
View
@@ -161,11 +161,12 @@ int msSLDApplySLD(mapObj *map, char *psSLDXML, int iLayer,
layerObj *psTmpLayer=NULL;
int nIndex;
char tmpId[128];
nIndex = msGetLayerIndex(map, pasLayers[m].name);
if(pasLayers[m].name == NULL) continue;
for (l=0; l<nLayers; l++) {
if(pasLayers[m].name == NULL || pasLayers[l].name == NULL)
if(pasLayers[l].name == NULL)
continue;
nIndex = msGetLayerIndex(map, pasLayers[m].name);
if (m !=l && strcasecmp(pasLayers[m].name, pasLayers[l].name)== 0 &&
nIndex != -1) {
ProTip! Use n and p to navigate between commits in a pull request.