Improve RPC message detection

To avoid crashing if an agent does `send([])`.

Kudos to @H0r53 for reporting!

Fixes frida/frida#1008.
This commit is contained in:
Ole André Vadla Ravnås
2019-09-03 23:51:50 +02:00
parent 66bdd0ed30
commit fd563fb312
+1 -1
View File
@@ -361,7 +361,7 @@ class Script(object):
level = message['level']
text = payload
self._log_handler(level, text)
elif mtype == 'send' and isinstance(payload, list) and payload[0] == 'frida:rpc':
elif mtype == 'send' and isinstance(payload, list) and len(payload) > 0 and payload[0] == 'frida:rpc':
request_id = payload[1]
operation = payload[2]
params = payload[3:]