diff --git a/Changes b/Changes index 46bd902a3..1cdc6c265 100644 --- a/Changes +++ b/Changes @@ -1690,3 +1690,4 @@ Darth Android (#0003738). - Fix NAMES with UHNAMES support, screwed it up at 'Win32 compile fixes' a few lines up... +- Fix OOB read caused by UHNAMES support. diff --git a/src/modules/m_names.c b/src/modules/m_names.c index 5a2547d8e..65450b74d 100644 --- a/src/modules/m_names.c +++ b/src/modules/m_names.c @@ -90,7 +90,7 @@ static char buf[BUFSIZE]; #define TRUNCATED_NAMES 64 DLLFUNC CMD_FUNC(m_names) { - int uhnames = SupportUHNAMES(sptr); // cache UHNAMES support + int uhnames = (MyConnect(sptr) && SupportUHNAMES(sptr)); // cache UHNAMES support int bufLen = NICKLEN + (!uhnames ? 0 : (1 + USERLEN + 1 + HOSTLEN)); int mlen = strlen(me.name) + bufLen + 7; aChannel *chptr;