After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 705400 - Dereferenced before NULL check
Dereferenced before NULL check
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal critical
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-03 12:00 UTC by Gaurav
Modified: 2013-08-04 15:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch fixes dereferencing a pointer before NUll check (624 bytes, patch)
2013-08-03 12:00 UTC, Gaurav
none Details | Review

Description Gaurav 2013-08-03 12:00:31 UTC
Created attachment 250764 [details] [review]
Patch fixes dereferencing a pointer before NUll check

In file :
https://git.gnome.org/browse/libxml2/tree/SAX2.c

Function : xmlSAX2StartDocument

At line: 997

ctxt->myDoc is dereferenced while checked against NULL at line:999
If NULL is returned at line : 996
 i.e ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL);
then statements:
     ctxt->myDoc->properties = XML_DOC_HTML;
     ctxt->myDoc->parseFlags = ctxt->options;
may lead to crash.

Patch for fix is attached.
Comment 1 Daniel Veillard 2013-08-03 14:18:02 UTC
Indeed, whoops :-)
Applied and pushed as commit a885f13a675d449e06529f9e68a6826acf45e19c

 thanks !

Daniel
Comment 2 Gaurav 2013-08-04 15:44:17 UTC
Thanks Daniel.
I have reported some dead code issues also, you are not committing them??