From fb7440bcb59312a9710f0bb12481d3d4edaab022 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 29 Mar 2022 08:08:48 +0200 Subject: idevicedebug: Only decode response if not OK, otherwise it may cause a buffer overrun Only decode the response if it's not OK, otherwise the O in "OK" can be interpreted as a hexadecimal and cause a buffer overrun. --- tools/idevicedebug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/idevicedebug.c b/tools/idevicedebug.c index 437faba..b0198a8 100644 --- a/tools/idevicedebug.c +++ b/tools/idevicedebug.c @@ -501,7 +501,9 @@ int main(int argc, char *argv[]) if (response) { log_debug("response: %s", response); - dres = debugserver_client_handle_response(debugserver_client, &response, 1); + if (strncmp(response, "OK", 2)) { + dres = debugserver_client_handle_response(debugserver_client, &response, 1); + } } sleep(1); -- cgit v1.1-32-gdbae