Skip to content

Commit

Permalink
WFS: fix segfault when issuing GetFeature on a layer that can't be op…
Browse files Browse the repository at this point in the history
…ened
  • Loading branch information
rouault committed Nov 6, 2013
1 parent 6a5935d commit dc7f35c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions mapwfs.c
Expand Up @@ -3188,9 +3188,8 @@ int msWFSGetFeature(mapObj *map, wfsParamsObj *paramsObj, cgiRequestObj *req,


msFreeCharArray(tokens, n); msFreeCharArray(tokens, n);
msLayerClose(lp); msLayerClose(lp);
}


if (strlen(papszPropertyName[k]) > 0) { if (strlen(papszPropertyName[k]) > 0) {


if (strcasecmp(papszPropertyName[k], "*") == 0) { if (strcasecmp(papszPropertyName[k], "*") == 0) {
/* Add all non-excluded items, including optional ones */ /* Add all non-excluded items, including optional ones */
Expand Down Expand Up @@ -3272,8 +3271,17 @@ int msWFSGetFeature(mapObj *map, wfsParamsObj *paramsObj, cgiRequestObj *req,
msInsertHashTable(&(lp->metadata), "GML_GEOMETRIES", "none"); msInsertHashTable(&(lp->metadata), "GML_GEOMETRIES", "none");
} }
} }
} else {/*empty string*/ } else {/*empty string*/
msInsertHashTable(&(lp->metadata), "GML_GEOMETRIES", "none"); msInsertHashTable(&(lp->metadata), "GML_GEOMETRIES", "none");
}
}
else
{
msFree(pszPropertyName);
if( papszPropertyName )
msFreeCharArray(papszPropertyName, numlayers);
msFreeCharArray(layers, numlayers);
return msWFSException(map, "mapserv", "NoApplicableCode", paramsObj->pszVersion);
} }


msGMLFreeItems(itemList); msGMLFreeItems(itemList);
Expand Down

0 comments on commit dc7f35c

Please sign in to comment.