Danek Duvall wrote:
> A user ran into this the other day:
> 
>     3325 pkg verify results in segmentation fault with some bad/damaged files
> 
> which resulted from a corrupt disk, and thus corrupt files.  Turns out the
> assert()s we had littered in our elf module weren't doing anything, since
> pycc turns on -DNDEBUG.  So it was time for some comprehensive reform.
> I've replaced all the assert()s with proper exceptions, added error
> handling in places it wasn't before, and even added a bit of plumbing.
> 
> The testsuite continues to pass with this change, and I've done a full
> import of build 96 and confirmed that at least some of the data is what it
> should be.  But we'll need some more comprehensive tests to tickle the
> various exception paths I've introduced.  I think Brad's working on that.
> 
> Anyway, the webrev is here:
> 
>     http://cr.opensolaris.org/~dduvall/pkg-elfexception/

elf.c:
   line 326: if for some bizarre reason, PyErr_NewException returned
null here, couldn't that cause a seg fault?  It would seem you want the
same check here as the one you have for Py_InitModule.

Only one other comment:
Why use malloc/free directly instead of PyMem_Malloc, PyMem_Free? [1]

Cheers,
-- 
Shawn Walker

[1] http://docs.python.org/api/memoryOverview.html
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to