summaryrefslogtreecommitdiff
path: root/tools/aapt2/StringPool.h
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2018-03-26 11:05:31 -0700
committerRyan Mitchell <rtmitchell@google.com>2018-04-04 15:54:43 +0000
commit70414f22dcab1d4ce3c2e9d981f3256a9ba62515 (patch)
tree4f16c1c60a077ba21af55e0df26d791143afa9cf /tools/aapt2/StringPool.h
parenta926126a8bc89c1a6bd7fa8a76332476eba0d954 (diff)
Check the size of the strings in the StringPool before flattening.
Test: Tested for normal functionality when string does not exceed maximum length and tests for detection of string that is too lonhg for UTF8i Bug: b/74176037 Change-Id: Ic71d3671a069e7012e8ca107e79e071499eebbf6 (cherry picked from commit a15c2a8957b9883cb293fdacaeabd7f2e037a0a5)
Diffstat (limited to 'tools/aapt2/StringPool.h')
-rw-r--r--tools/aapt2/StringPool.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/aapt2/StringPool.h b/tools/aapt2/StringPool.h
index 3c1f3dc3a1bb..f5b464de2ea5 100644
--- a/tools/aapt2/StringPool.h
+++ b/tools/aapt2/StringPool.h
@@ -27,6 +27,7 @@
#include "androidfw/StringPiece.h"
#include "ConfigDescription.h"
+#include "Diagnostics.h"
#include "util/BigBuffer.h"
namespace aapt {
@@ -152,8 +153,8 @@ class StringPool {
int ref_;
};
- static bool FlattenUtf8(BigBuffer* out, const StringPool& pool);
- static bool FlattenUtf16(BigBuffer* out, const StringPool& pool);
+ static bool FlattenUtf8(BigBuffer* out, const StringPool& pool, IDiagnostics* diag);
+ static bool FlattenUtf16(BigBuffer* out, const StringPool& pool, IDiagnostics* diag);
StringPool() = default;
StringPool(StringPool&&) = default;
@@ -207,7 +208,7 @@ class StringPool {
private:
DISALLOW_COPY_AND_ASSIGN(StringPool);
- static bool Flatten(BigBuffer* out, const StringPool& pool, bool utf8);
+ static bool Flatten(BigBuffer* out, const StringPool& pool, bool utf8, IDiagnostics* diag);
Ref MakeRefImpl(const android::StringPiece& str, const Context& context, bool unique);
void ReAssignIndices();