mirror of
https://github.com/androguard/androguard.git
synced 2024-11-23 05:00:11 +00:00
supplementary for 1006
This commit is contained in:
parent
e45e584137
commit
05c02efd1a
@ -2230,11 +2230,12 @@ class ARSCHeader:
|
||||
if possible_types:
|
||||
while True:
|
||||
cur_pos = buff.tell()
|
||||
if buff.raw.getbuffer().nbytes < cur_pos + self.SIZE:
|
||||
# reached end of the file, cases where packers set the EndNamespace with zero size require that
|
||||
return
|
||||
self._type, self._header_size, self._size = unpack('<HHL', buff.read(self.SIZE))
|
||||
|
||||
# cases where packers set the EndNamespace with zero size: check we are the end and add the prefix + uri
|
||||
if self._size < self.SIZE and (buff.raw.getbuffer().nbytes == cur_pos + self._header_size + 4 + 4):
|
||||
self._size = 24
|
||||
|
||||
if cur_pos == 0 or (
|
||||
self._type in possible_types and self._header_size >= self.SIZE and self._size > self.SIZE):
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user