From 6a837bf669c78eb5bfc4b532709d76ec6ad1c52a Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Fri, 10 Oct 2025 08:40:06 +0200 Subject: [PATCH] inetntop() was using a wrong sizeof() which could trigger a message about an overflow with eg 'STATS maxperip' (IRCOp-only command). Also, STATS maxperip failed to return 1 in the hook, resulting in unnecessary STATS help output after the list. --- src/modules/maxperip.c | 2 +- src/support.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/maxperip.c b/src/modules/maxperip.c index ae2104192..73f640ebb 100644 --- a/src/modules/maxperip.c +++ b/src/modules/maxperip.c @@ -340,7 +340,7 @@ int stats_maxperip(Client *client, const char *para) } } - return 0; + return 1; } /** Returns 1 if allow::maxperip is exceeded by 'client' */ diff --git a/src/support.c b/src/support.c index d8dc8df93..5addaef86 100644 --- a/src/support.c +++ b/src/support.c @@ -142,7 +142,7 @@ const char *inetntop(int af, const void *in, char *out, size_t size) { char tmp[MYDUMMY_SIZE]; - inet_ntop(af, in, tmp, size); + inet_ntop(af, in, tmp, sizeof(tmp)); if (!strstr(tmp, "::")) { /* IPv4 or IPv6 that is already uncompressed */