[xml] xpath.c patch
- From: Gary Pennington <Gary Pennington uk sun com>
- To: "xml gnome org" <xml gnome org>
- Subject: [xml] xpath.c patch
- Date: Tue, 11 Sep 2001 17:44:56 +0100
Hi,
I'm doing some testing of my application and injecting random malloc
failures to see how the application holds up. This has uncovered a
number of faults in the application and also some in the libraries that
it uses.
This patch should prevent one of the more common error conditions in the
XPath code if a malloc fails in xmlXPathNewParserContext:
libxml2: 2.4.3
bash-2.04$ diff -c xpath.c.ORIG xpath.c
*** xpath.c.ORIG Tue Sep 11 17:31:49 2001
--- xpath.c Tue Sep 11 17:37:00 2001
***************
*** 9798,9804 ****
CHECK_CONTEXT(ctx)
! ctxt = xmlXPathNewParserContext(str, ctx);
xmlXPathEvalExpr(ctxt);
if (ctxt->value == NULL) {
--- 9798,9806 ----
CHECK_CONTEXT(ctx)
! if ((ctxt = xmlXPathNewParserContext(str, ctx)) == NULL)
! return (NULL);
!
xmlXPathEvalExpr(ctxt);
if (ctxt->value == NULL) {
bash-2.04$
Gary
--
Gary Pennington
Solaris Kernel Development,
Sun Microsystems
Gary Pennington sun com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]