GNOME Bugzilla – Bug 729849
Avoid Possible null pointer dereference in xmlmemory.c
Last modified: 2014-05-09 09:02:08 UTC
Created attachment 276209 [details] [review] Avoid Possible null pointer dereference in xmlmemory.c In file: https://git.gnome.org/browse/libxml2/tree/xmlmemory.c static void xmlMemContentShow(FILE *fp, MEMHDR *p) { int i,j,k,len = p->mh_size; const char *buf = (const char *) HDR_2_CLIENT(p); if (p == NULL) { fprintf(fp, " NULL"); return; } Here "p" is dereferenced before NULL check. Hence if p is NULL, it may crash before NULL check. Please apply attached patch. Thanks.
Ah right, but it's a normal bug, the option of building the memory list and being able to dump part of the content is only activated on build with memory debug, it cannot be used in production as xmlFree and xmlMalloc are then incompatible with free and malloc C library routines. Fixed as commit 7966a761b77d24a70e8b81057c48319e32fbcc29 thanks ! Daniel