summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Greg Dennis2022-03-29 08:08:48 +0200
committerGravatar Nikias Bassen2022-03-29 08:08:48 +0200
commitfb7440bcb59312a9710f0bb12481d3d4edaab022 (patch)
tree4a85377bc454d4881c2acff54ace981c410dea14
parent02d4549205ced029014a1362519cb3ba67727c9b (diff)
downloadlibimobiledevice-fb7440bcb59312a9710f0bb12481d3d4edaab022.tar.gz
libimobiledevice-fb7440bcb59312a9710f0bb12481d3d4edaab022.tar.bz2
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.
-rw-r--r--tools/idevicedebug.c4
1 files changed, 3 insertions, 1 deletions
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[])
501 501
502 if (response) { 502 if (response) {
503 log_debug("response: %s", response); 503 log_debug("response: %s", response);
504 dres = debugserver_client_handle_response(debugserver_client, &response, 1); 504 if (strncmp(response, "OK", 2)) {
505 dres = debugserver_client_handle_response(debugserver_client, &response, 1);
506 }
505 } 507 }
506 508
507 sleep(1); 509 sleep(1);