diff options
| author | 2012-10-10 10:23:47 -0700 | |
|---|---|---|
| committer | 2012-10-10 10:25:06 -0700 | |
| commit | 32d6aef11abd4660fc764ffa53bd88c7589f2d35 (patch) | |
| tree | c316a098be821eed2bc471905d588af94bbb1d38 /libs/androidfw | |
| parent | cee1124052202c7f2a1956a54e5aa538d82197a7 (diff) | |
Reject bad ResXMLTree::setTo calls
Bug: http://code.google.com/p/android/issues/detail?id=21838
Change-Id: I1092499906f0cafe5a3c42ab2579edf3763cedb7
Diffstat (limited to 'libs/androidfw')
| -rw-r--r-- | libs/androidfw/ResourceTypes.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp index 8cce191e3e8b..79cd5bbc4dc4 100644 --- a/libs/androidfw/ResourceTypes.cpp +++ b/libs/androidfw/ResourceTypes.cpp @@ -1209,6 +1209,10 @@ status_t ResXMLTree::setTo(const void* data, size_t size, bool copyData) uninit(); mEventCode = START_DOCUMENT; + if (!data || !size) { + return (mError=BAD_TYPE); + } + if (copyData) { mOwnedData = malloc(size); if (mOwnedData == NULL) { |