Ticket #2803 (closed defect: fixed)
mapserver will crash when rendering a query map in HILITE mode and there are is no STYLE defined
| Reported by: | unicoletti | Owned by: | sdlime |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.2.1 release |
| Component: | MapServer C Library | Version: | svn-trunk (development) |
| Severity: | normal | Keywords: | |
| Cc: | dmorissette, sdlime, sholl, unicoletti |
Description
mapserver (and mapscript) will crash when the following conditions are both true:
- rendering a query map in HILITE mode
- tha map has at least one queried layer with a class without any STYLE element
the crash occurs in mapdraw.c:msDrawQueryLayer because the code dereferences a pointer without checking first. The same map used to work in versions < 5 and the bug was introduced by the refactoring of layers, classes and styles from arrays of structs to arrays of pointers.
Proposed fix: a new style should be allocated on the fly on pushed on the array. This however must be done carefully so that the reference counting code is notified of the new element.
This issue was brought up in mapserver-users mailing list, thread 'MS 5.2.0 and QUERYMAP Hilite', reference to gmane will be made when available.

