Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ef152ad authored by Vishwath Mohan's avatar Vishwath Mohan Committed by Android (Google) Code Review
Browse files

Merge "Handle malformed manifests in printXMLBlock"

parents 8c6e4b39 9b754a1b
Loading
Loading
Loading
Loading
+22 −14
Original line number Diff line number Diff line
@@ -520,7 +520,12 @@ void printXMLBlock(ResXMLTree* block)
                printf("\n");
            }
        } else if (code == ResXMLTree::END_TAG) {
            depth--;
            // Invalid tag nesting can be misused to break the parsing
            // code below. Break if detected.
            if (--depth < 0) {
                printf("***BAD DEPTH in XMLBlock: %d\n", depth);
                break;
            }
        } else if (code == ResXMLTree::START_NAMESPACE) {
            namespace_entry ns;
            size_t len;
@@ -536,7 +541,10 @@ void printXMLBlock(ResXMLTree* block)
                    ns.uri.string());
            depth++;
        } else if (code == ResXMLTree::END_NAMESPACE) {
            depth--;
            if (--depth < 0) {
                printf("***BAD DEPTH in XMLBlock: %d\n", depth);
                break;
            }
            const namespace_entry& ns = namespaces.top();
            size_t len;
            const char16_t* prefix16 = block->getNamespacePrefix(&len);