Opened 8 years ago

Closed 6 years ago

#1304 closed defect (fixed)

Possible bug in constructor MgSelection (MgMap *map, CREFSTRING xmlSelectionString) triggered by empty xmlSelectionString

Reported by: gabrimonfa Owned by:
Priority: low Milestone: 2.4
Component: Server Version: 2.2.0
Severity: trivial Keywords: haspatch
Cc: External ID:

Description

I have mapguide 2.1.0 on Debian etch with apache (let's call it mapguide_apache) and php. In my setup main apache web server is configured to use mapguide_apache with proxy/reverseProxy directives.

If MgSelection? (MgMap? *map, CREFSTRING xmlSelectionString) is called with an empty xmlSelectionString (it happens when no elements are selected in the map), my main apache logs:

502 Proxy Error

while mapguide_apache logs

[notice] child pid 24438 exit signal Segmentation fault (11)

The server appears to continue without problems but I'm not sure since I have also sporadic crashes (without log entries...)

Attachments (3)

1304.patch (12.3 KB) - added by jng 6 years ago.
1304_v2.patch (3.3 KB) - added by jng 6 years ago.
1304_v3.patch (3.5 KB) - added by jng 6 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 8 years ago by jng

The MgSelection? constructor just delegates to its parent constructor, which internally calls the FromXml?() method (http://trac.osgeo.org/mapguide/browser/trunk/MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp#L104)

From what I can see, it just assumes as though the selection string is not empty (it doesn't actually check for an empty string).

I guess the solution is to check for an empty string, but then what to do once we encounter an empty string? Do nothing (return)? Throw MG exception?

comment:2 Changed 7 years ago by gabrimonfa

Version: 2.1.02.2.0

Is that solved in 2.2RC1 or in trunk?

Changed 6 years ago by jng

Attachment: 1304.patch added

comment:3 Changed 6 years ago by jng

Keywords: haspatch added
Milestone: 2.4

Changed 6 years ago by jng

Attachment: 1304_v2.patch added

Changed 6 years ago by jng

Attachment: 1304_v3.patch added

comment:4 Changed 6 years ago by jng

Resolution: fixed
Status: newclosed

Fixed trunk (r6758) and 2.4 (r6756)

Note: See TracTickets for help on using tickets.