mirror of
https://github.com/mon/kbinxml.git
synced 2026-03-21 18:04:52 -05:00
is_binary_xml: don't explode on too-short inputs
This commit is contained in:
parent
3cbc3179a8
commit
5707a6bf8b
|
|
@ -68,6 +68,9 @@ class KBinXML():
|
|||
|
||||
@staticmethod
|
||||
def is_binary_xml(input):
|
||||
if len(input) < 2:
|
||||
return False
|
||||
|
||||
nodeBuf = ByteBuffer(input)
|
||||
return (nodeBuf.get_u8() == SIGNATURE and
|
||||
nodeBuf.get_u8() in (SIG_COMPRESSED, SIG_UNCOMPRESSED))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user