aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/network.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2025-03-19 00:34:56 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2025-03-19 00:34:56 +0100
commitc136f43f30bc9c5648d8304036981d7b5c6034a3 (patch)
tree7d6248a69ef6d4cd0b3acb2f4361a6736fc303be /FICS/network.c
parente565644dde4c4bd4c339c3c9516d0639c5284897 (diff)
Fixed untrusted loop bound
Diffstat (limited to 'FICS/network.c')
-rw-r--r--FICS/network.c4
1 files changed, 3 insertions, 1 deletions
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 */;
}