Skip to content

Commit

Permalink
Fix segfault in queryByFilter function in PHP/MapScript
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Boudreault committed Aug 29, 2012
1 parent 444f209 commit 5ca7cf0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions HISTORY.TXT
Expand Up @@ -14,6 +14,8 @@ For a complete change history, please see the Git log comments.
Current Version (future 6.2.0-beta2, GIT branch-6-2):
-------------------------------------------------

- Fix segfault in queryByFilter function in PHP/MapScript

- Adjusted mediatype to multipart/related in WCS 2.0 (#4003)

- Fix symbolObj.getImage seg fault in PHP/MapScript
Expand Down
6 changes: 6 additions & 0 deletions mapscript/php/mapscript_i.c
Expand Up @@ -213,6 +213,9 @@ int mapObj_queryByFilter(mapObj* self, char *string)
self->query.type = MS_QUERY_BY_FILTER;

self->query.filter = (expressionObj *) malloc(sizeof(expressionObj));
self->query.filter->compiled = MS_FALSE;
self->query.filter->flags = 0;
self->query.filter->tokens = self->query.filter->curtoken = NULL;
self->query.filter->string = strdup(string);
self->query.filter->type = 2000; /* MS_EXPRESSION: lot's of conflicts in mapfile.h */

Expand Down Expand Up @@ -696,6 +699,9 @@ int layerObj_queryByFilter(layerObj *self, mapObj *map, char *string)
map->query.filter = (expressionObj *) malloc(sizeof(expressionObj));
map->query.filter->string = strdup(string);
map->query.filter->type = 2000; /* MS_EXPRESSION: lot's of conflicts in mapfile.h */
map->query.filter->compiled = MS_FALSE;
map->query.filter->flags = 0;
map->query.filter->tokens = map->query.filter->curtoken = NULL;

map->query.layer = self->index;
map->query.rect = map->extent;
Expand Down

0 comments on commit 5ca7cf0

Please sign in to comment.