diff options
| author | 2014-10-20 22:01:04 +0000 | |
|---|---|---|
| committer | 2014-10-20 22:01:04 +0000 | |
| commit | 11d3d1016bf7064f0232278eb0a798dfb33ab00f (patch) | |
| tree | 9125aaa3feb70687ed87a6c31c6016c060a49544 /tools/aapt/Resource.cpp | |
| parent | 22cf018313fd2b427c16002a5a14354342b6075e (diff) | |
| parent | 9295a1354eb8220be9a0a40985253c6cdfac35c3 (diff) | |
am 9295a135: am e40974d9: Merge "Fix an overflow found by ASAN."
* commit '9295a1354eb8220be9a0a40985253c6cdfac35c3':
Fix an overflow found by ASAN.
Diffstat (limited to 'tools/aapt/Resource.cpp')
| -rw-r--r-- | tools/aapt/Resource.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index 0c0e639acf9e..b5590026d9d2 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -547,7 +547,7 @@ static int validateAttr(const String8& path, const ResTable& table, String8(parser.getElementName(&len)).string(), attr); return ATTR_LEADING_SPACES; } - if (str[len-1] == ' ') { + if (len != 0 && str[len-1] == ' ') { fprintf(stderr, "%s:%d: Tag <%s> attribute %s can not end with a space.\n", path.string(), parser.getLineNumber(), String8(parser.getElementName(&len)).string(), attr); |