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 708364 - Pointer dereferenced before null check (valid.c)
Pointer dereferenced before null check (valid.c)
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-09-19 12:09 UTC by Gaurav
Modified: 2013-09-30 02:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixing possible Pointer Dereference before NULL check. (402 bytes, patch)
2013-09-19 12:09 UTC, Gaurav
none Details | Review

Description Gaurav 2013-09-19 12:09:04 UTC
Created attachment 255296 [details] [review]
Fixing possible Pointer Dereference before NULL check.

In file https://git.gnome.org/browse/libxml2/tree/valid.c
In function:
xmlValidateElementContent(xmlValidCtxtPtr ctxt, xmlNodePtr child,
       xmlElementPtr elemDecl, int warn, xmlNodePtr parent)

variable ctxt is derefernced at many instances before null check at
line no:5439
if (ctxt != NULL) { -----

So, if ctxt is NULL before this check, dereferencing it may cause crash.

Attached patch fixes this.
Comment 1 Daniel Veillard 2013-09-30 02:46:50 UTC
Applied and puhed:

https://git.gnome.org/browse/libxml2/commit/?id=c570b37972b364d03605a0c67b8497bc4b3227af

thanks !

Daniel