Exploit databaseDownload repository ZIP
GH-12737d57f49df9711fa1c097c9e9ec1d
nanopathi/framework_base_aosp10_r33_cve-2021-0472
Sources for CVE-2021-0472
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files12
nanopathi/framework_base_aosp10_r33_cve-2021-0472Revision 14f1ba804544
- ↑..Parent directory
- XmlActionExecutor.cpp
- XmlActionExecutor.h
- XmlActionExecutor_test.cpp
- XmlDom.cpp
- XmlDom.h
- XmlDom_test.cpp
- XmlPullParser.cpp
- XmlPullParser.h
- XmlPullParser_test.cpp
- XmlUtil.cpp
- XmlUtil.h
- XmlUtil_test.cpp
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
tools/aapt2/xml/XmlPullParser_test.cpp
C++ · 2,260 bytes/*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "xml/XmlPullParser.h"
#include "androidfw/StringPiece.h"
#include "io/StringStream.h"
#include "test/Test.h"
using ::aapt::io::StringInputStream;
using ::android::StringPiece;
using ::testing::Eq;
using ::testing::StrEq;
using Event = ::aapt::xml::XmlPullParser::Event;
namespace aapt {
namespace xml {
TEST(XmlPullParserTest, NextChildNodeTraversesCorrectly) {
std::string str =
R"(<?xml version="1.0" encoding="utf-8"?>
<a><b><c xmlns:a="http://schema.org"><d/></c><e/></b></a>)";
StringInputStream input(str);
XmlPullParser parser(&input);
const size_t depth_outer = parser.depth();
ASSERT_TRUE(XmlPullParser::NextChildNode(&parser, depth_outer));
EXPECT_THAT(parser.event(), Eq(XmlPullParser::Event::kStartElement));
EXPECT_THAT(parser.element_name(), StrEq("a"));
const size_t depth_a = parser.depth();
ASSERT_TRUE(XmlPullParser::NextChildNode(&parser, depth_a));
EXPECT_THAT(parser.event(), Eq(XmlPullParser::Event::kStartElement));
EXPECT_THAT(parser.element_name(), StrEq("b"));
const size_t depth_b = parser.depth();
ASSERT_TRUE(XmlPullParser::NextChildNode(&parser, depth_b));
EXPECT_THAT(parser.event(), Eq(XmlPullParser::Event::kStartElement));
EXPECT_THAT(parser.element_name(), StrEq("c"));
ASSERT_TRUE(XmlPullParser::NextChildNode(&parser, depth_b));
EXPECT_THAT(parser.event(), Eq(XmlPullParser::Event::kStartElement));
EXPECT_THAT(parser.element_name(), StrEq("e"));
ASSERT_FALSE(XmlPullParser::NextChildNode(&parser, depth_outer));
EXPECT_THAT(parser.event(), Eq(XmlPullParser::Event::kEndDocument));
}
} // namespace xml
} // namespace aapt