cheetah
cheetah copied to clipboard
segfault grabbing attributes off of objects that implement __getattribute__
_namemapper.c:PyNamemapper_valueForName calls PyObject_GetAttrString and doesn't check its return value for NULL. It does check PyErr_Occurred(), but that isn't being triggered in this case (which looks like a bug in the python c api -- I was getting this sporadically on a live service running python 2.4.6).
It should be checking for NULL as well and setting a python error and returning NULL in that case.
We worked around this by overriding getattr instead of getattribute (which should have been done in the first place), but the python issue, not protected against by cheetah, is still there.
Mind checking out SHA: e8352935d01dbf1f20a8bc6aecc3c40592508435 to see if that's sufficient?
the only place I've seen it happen was at work, and we got rid of our getattribute usage there (and I'm not sure how folks would feel about reintroducing it to test cheetah), but on my own time I'll try and write up a repro script.