GNOME Bugzilla – Bug 730005
Avoid Possible Null Pointer in trio.c
Last modified: 2014-07-14 13:24:18 UTC
Created attachment 276375 [details] [review] Avoid Possible null pointer dereference in trio.c In file : https://git.gnome.org/browse/libxml2/tree/trio.c TRIO_PRIVATE void TrioInStreamFile TRIO_ARGS2((self, intPointer), trio_class_t *self, int *intPointer) { FILE *file = (FILE *)self->location; assert(VALID(self)); assert(VALID(file)); and TRIO_PRIVATE void TrioInStreamFileDescriptor TRIO_ARGS2((self, intPointer), trio_class_t *self, int *intPointer) { int fd = *((int *)self->location); int size; unsigned char input; assert(VALID(self)); self is dereferenced before NULL check and hence may create crash scenario. Please apply attached patch.
Okay, asserts are a really bad idea in libxml2, but crashing is worse. Applied as commit e036cb3160378d7c46f99434de07c065ebb05bc9 thanks, Daniel