Permalink
Browse files

Fixing segfault for POST requests when no content-type is set. See is…

…sue #4650.
  • Loading branch information...
1 parent 37455d7 commit cec80bf80d0fa65ec9dcc977536ffeaa371db0e0 @constantinius constantinius committed May 7, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 mapows.c
View
@@ -95,7 +95,8 @@ static int msOWSPreParseRequest(cgiRequestObj *request,
owsRequestObj *ows_request)
{
/* decide if KVP or XML */
- if (request->type == MS_GET_REQUEST || (request->type == MS_POST_REQUEST && strcmp(request->contenttype, "application/x-www-form-urlencoded")==0)) {
+ if (request->type == MS_GET_REQUEST || (request->type == MS_POST_REQUEST
+ && request->contenttype && EQUAL(request->contenttype, "application/x-www-form-urlencoded"))) {
int i;
/* parse KVP parameters service, version and request */
for (i = 0; i < request->NumParams; ++i) {

0 comments on commit cec80bf

Please sign in to comment.