From fd563fb31226e5b62deac756a07b1ef2cee04769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Tue, 3 Sep 2019 23:51:50 +0200 Subject: [PATCH] Improve RPC message detection To avoid crashing if an agent does `send([])`. Kudos to @H0r53 for reporting! Fixes frida/frida#1008. --- frida/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frida/core.py b/frida/core.py index 1e05897..8789536 100644 --- a/frida/core.py +++ b/frida/core.py @@ -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:]