Closed tbonfort closed 12 years ago
Author: sdlime Date: 2007/08/09 - 20:44 Sean: Should msUpdateClassFromString() just return silently then if !class->layer? I don't see an alternative although I should see if we could plod through loading sub-objects with a NULL map or layer. Basically the loadObject functions would need to be more bullet proof...
Steve
Author: sgillies Date: 2007/08/09 - 20:57 The only use loadClass makes of the map is as a container for the templatepattern. I suggest we change the signature of loadClass from
int loadClass(classObj *class, mapObj *map, layerObj *layer)
to
int loadClass(classObj *class, char *templatepattern, layerObj *layer)
I also just noticed that loadClass never even uses the layer parameter. That should be eliminated while we're at it. loadClass is only called 3 times in mapfile.c so it's a small fix.
Author: sdlime Date: 2007/08/09 - 21:06 Sounds ok, could you make the change?
Steve
Author: sgillies Date: 2007/08/09 - 21:28 Committed to 8a7b82582d750f51e70040f0752db9f2e71faf5e (r6542). Mapscript tests look ok, no related failures. Try it out?
Author: sdlime Date: 2007/08/31 - 05:41 I believe this one is good to go... Thanks Sean!
Steve
Reporter: sgillies Date: 2007/08/09 - 20:34 Since version 4.4 (maybe even earlier), we've been allowing users to create independent classObjs like
My current implementation of mapscript.fromstring (for RFC 31) leverages that to create new classObjs from a string:
Currently, msUpdateClassFromString assumes that a classObj has a parent layerObj and we get a segfault. From running the doctest:
class->layer is NULL at that point. Solution: do not dereference class->layer if it is NULL.