diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2019-02-15 16:02:09 -0800 |
---|---|---|
committer | Ryan Mitchell <rtmitchell@google.com> | 2019-02-15 16:04:37 -0800 |
commit | 2f9077dfbbcdb72276a6cbbf9e9cdbf89ccbf16f (patch) | |
tree | 78420926cdc4bbaa9160930323f1c11777b9f3f5 /tools/aapt2/ResourceParser.cpp | |
parent | 01d1fd33b7e9a677435f3cae280c93e064012fd9 (diff) |
Fix seg faul when parsing invalid <plurals>
If the inner element of a <plurals> tag fails to parse, aapt2 will seg
fault. Don't do that.
Bug: 123423125
Test: manual
Change-Id: Iff39fa84073da62d85279683ac3d03b7309bc5e3
Diffstat (limited to 'tools/aapt2/ResourceParser.cpp')
-rw-r--r-- | tools/aapt2/ResourceParser.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/aapt2/ResourceParser.cpp b/tools/aapt2/ResourceParser.cpp index 2f8ca2d62061..7827e950a602 100644 --- a/tools/aapt2/ResourceParser.cpp +++ b/tools/aapt2/ResourceParser.cpp @@ -1623,7 +1623,9 @@ bool ResourceParser::ParsePlural(xml::XmlPullParser* parser, if (!(plural->values[index] = ParseXml( parser, android::ResTable_map::TYPE_STRING, kNoRawString))) { error = true; + continue; } + plural->values[index]->SetSource(item_source); } else if (!ShouldIgnoreElement(element_namespace, element_name)) { |