mirror of
https://github.com/mon/kbinxml.git
synced 2026-04-26 02:01:45 -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
|
@staticmethod
|
||||||
def is_binary_xml(input):
|
def is_binary_xml(input):
|
||||||
|
if len(input) < 2:
|
||||||
|
return False
|
||||||
|
|
||||||
nodeBuf = ByteBuffer(input)
|
nodeBuf = ByteBuffer(input)
|
||||||
return (nodeBuf.get_u8() == SIGNATURE and
|
return (nodeBuf.get_u8() == SIGNATURE and
|
||||||
nodeBuf.get_u8() in (SIG_COMPRESSED, SIG_UNCOMPRESSED))
|
nodeBuf.get_u8() in (SIG_COMPRESSED, SIG_UNCOMPRESSED))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user