Ticket #554 (closed defect: fixed)
memory overwrite in mapxbase.c
|Reported by:||woodbri@…||Owned by:||jmckenna@…|
|Component:||MapServer C Library||Version:||4.1|
I have been able to track down a problem I was having working with Navtech data. It seems that they generate shapefiles for some layers that appear to have valid dbf files that do not have any attribute fields defined in them. I looks like when these are accessed via a tileindex there is some kind of memory overwrite happening. I had a streets layer that was defined after this offending layer that was acting weird like all that attributes were off by one or were being pulled from the wrong column. When I commented out this layer everything when back to normal. OK, reading some code looks like mapxbase.c is not checking for the case where nFields = 0 and is doing a bunch of malloc on zero bytes and then stuffing values into those zero byte locations. I'll write a bug on this also and while you might argue that I should not have a dbf without attributes, I don't see any reason I shouldn't but this is a nasty memory overwrite condidtion that I have been fighting with off and on for 3 weeks and needs to be fixed one way or another.
Note: See TracTickets for help on using tickets.