From c136f43f30bc9c5648d8304036981d7b5c6034a3 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Wed, 19 Mar 2025 00:34:56 +0100 Subject: Fixed untrusted loop bound --- FICS/network.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FICS/network.c b/FICS/network.c index c9fae65..b795e99 100644 --- a/FICS/network.c +++ b/FICS/network.c @@ -267,7 +267,9 @@ net_send_string(int fd, char *str, int format) if ((which = findConnection(fd)) < 0) return -1; while (*str) { - for (i = 0; str[i] >= ' '; i++) { + const int upbound = strlen(str); + + for (i = 0; i < upbound && str[i] >= ' '; i++) { /* null */; } -- cgit v1.2.3