|
1 This patch taken directly from upstream: |
|
2 http://git.gnome.org/browse/libxml2/commit/?id=1d4526f6f4ec8d18c40e2a09b387652a6c1aa2cd |
|
3 --- libxml2-2.7.6/xpath.c Fri Dec 9 06:34:26 2011 |
|
4 +++ libxml2-2.7.6/new.xpath.c Fri Dec 9 06:43:12 2011 |
|
5 @@ -2485,6 +2485,7 @@ |
|
6 sizeof(ctxt->valueTab[0])); |
|
7 if (tmp == NULL) { |
|
8 xmlGenericError(xmlGenericErrorContext, "realloc failed !\n"); |
|
9 + ctxt->error = XPATH_MEMORY_ERROR; |
|
10 return (0); |
|
11 } |
|
12 ctxt->valueMax *= 2; |
|
13 @@ -9327,6 +9328,7 @@ |
|
14 if ( (ch & 0xc0) != 0xc0 ) { |
|
15 xmlGenericError(xmlGenericErrorContext, |
|
16 "xmlXPathTranslateFunction: Invalid UTF8 string\n"); |
|
17 + /* not asserting an XPath error is probably better */ |
|
18 break; |
|
19 } |
|
20 /* then skip over remaining bytes for this char */ |
|
21 @@ -9334,6 +9336,7 @@ |
|
22 if ( (*cptr++ & 0xc0) != 0x80 ) { |
|
23 xmlGenericError(xmlGenericErrorContext, |
|
24 "xmlXPathTranslateFunction: Invalid UTF8 string\n"); |
|
25 + /* not asserting an XPath error is probably better */ |
|
26 break; |
|
27 } |
|
28 if (ch & 0x80) /* must have had error encountered */ |
|
29 @@ -13384,6 +13387,7 @@ |
|
30 xmlGenericError(xmlGenericErrorContext, |
|
31 "xmlXPathCompOpEval: variable %s bound to undefined prefix %s\n", |
|
32 (char *) op->value4, (char *)op->value5); |
|
33 + ctxt->error = XPATH_UNDEF_PREFIX_ERROR; |
|
34 return (total); |
|
35 } |
|
36 val = xmlXPathVariableLookupNS(ctxt->context, |
|
37 @@ -13438,6 +13442,7 @@ |
|
38 "xmlXPathCompOpEval: function %s bound to undefined prefix %s\n", |
|
39 (char *)op->value4, (char *)op->value5); |
|
40 xmlXPathPopFrame(ctxt, frame); |
|
41 + ctxt->error = XPATH_UNDEF_PREFIX_ERROR; |
|
42 return (total); |
|
43 } |
|
44 func = xmlXPathFunctionLookupNS(ctxt->context, |
|
45 @@ -14016,6 +14021,7 @@ |
|
46 } |
|
47 xmlGenericError(xmlGenericErrorContext, |
|
48 "XPath: unknown precompiled operation %d\n", op->op); |
|
49 + ctxt->error = XPATH_INVALID_OPERAND; |
|
50 return (total); |
|
51 } |
|
52 |