fix crash when importing python module
Status: Beta
Brought to you by:
spadix
the python code does:
static PyGetSetDef imagescanner_getset[] = { { "results", (getter)imagescanner_get_results, }, };
that lacks a trailing sentinel. that means if the structure doesn't happen to just have zeroed data following it, python will walk random memory trying to load them. on x86, it seems the default padding/whatever happens to include zero bytes, so it doesn't crash. but on arm, the data is packed tighter and python crashes.
Debian has an example report:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702499
simple fix:
--- a/python/imagescanner.c +++ b/python/imagescanner.c @@ -68,6 +68,7 @@ imagescanner_get_results (zbarImageScanner *self, static PyGetSetDef imagescanner_getset[] = { { "results", (getter)imagescanner_get_results, }, + { NULL }, }; static PyObject*
Too bad I didn't see this comment - took me a few hours to reach the same solution. :(
It this issue going to get resolved in the main repo? I ran into the same problem and took me way too long to find the solution.