From c122e0563d815ac2ad7ae8d6edd2e53ec8dd52a6 Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Mon, 3 Feb 2025 10:23:02 +0000 Subject: [PATCH] Coverity CID 468110/468131 - fix newly detected error THe previous commit unmasked another potential error in Coverity, which is addressed by tightening up return value restrictions. --- tools/devel/tcp_proxy/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/devel/tcp_proxy/main.c b/tools/devel/tcp_proxy/main.c index 350037b5..c22da603 100644 --- a/tools/devel/tcp_proxy/main.c +++ b/tools/devel/tcp_proxy/main.c @@ -275,7 +275,7 @@ main_loop(char *local_port, char *remote_ip, char *remote_port, int hexdump) g_tcp_socket_ok(con_sck); } } - else if (i < 1) + else if (i < 1 || i > (count - sent)) { error = 1; }