summary refs log tree commit diff
path: root/gnu/packages/patches/icecat-CVE-2016-1964.patch
blob: e53fc749b572cf5eca0324d0307dbae95ac5290d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Copied from upstream:
https://hg.mozilla.org/releases/mozilla-esr38/raw-rev/a653013e7b50

# HG changeset patch
# User Peter Van der Beken <peterv@propagandism.org>
# Date 1454340035 -3600
# Node ID a653013e7b503912a32621e8da64a37171316588
# Parent  0d0d7e8292f7ecf5f1149d528c0524f04447c4ad
Bug 1243335 - report bad QName. r=sicking, a=sylvestre

diff --git a/dom/xslt/xslt/txInstructions.cpp b/dom/xslt/xslt/txInstructions.cpp
--- a/dom/xslt/xslt/txInstructions.cpp
+++ b/dom/xslt/xslt/txInstructions.cpp
@@ -93,16 +93,19 @@ txAttribute::txAttribute(nsAutoPtr<Expr>
                          txNamespaceMap* aMappings)
     : mName(Move(aName)), mNamespace(Move(aNamespace)), mMappings(aMappings)
 {
 }
 
 nsresult
 txAttribute::execute(txExecutionState& aEs)
 {
+    nsAutoPtr<txTextHandler> handler(
+        static_cast<txTextHandler*>(aEs.popResultHandler()));
+
     nsAutoString name;
     nsresult rv = mName->evaluateToString(aEs.getEvalContext(), name);
     NS_ENSURE_SUCCESS(rv, rv);
 
     const char16_t* colon;
     if (!XMLUtils::isValidQName(name, &colon) ||
         TX_StringEqualsAtom(name, nsGkAtoms::xmlns)) {
         return NS_OK;
@@ -125,19 +128,16 @@ txAttribute::execute(txExecutionState& a
         if (!nspace.IsEmpty()) {
             nsId = txNamespaceManager::getNamespaceID(nspace);
         }
     }
     else if (colon) {
         nsId = mMappings->lookupNamespace(prefix);
     }
 
-    nsAutoPtr<txTextHandler> handler(
-        static_cast<txTextHandler*>(aEs.popResultHandler()));
-
     // add attribute if everything was ok
     return nsId != kNameSpaceID_Unknown ?
            aEs.mResultHandler->attribute(prefix, Substring(name, lnameStart),
                                          nsId, handler->mValue) :
            NS_OK;
 }
 
 txCallTemplate::txCallTemplate(const txExpandedName& aName)