From 8fc0a9b6214837697762150bdee5052f1ead7b58 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sun, 1 Mar 2009 01:58:53 +0100 Subject: [PATCH] Correct WHOX overflow check so it also works for fields other than the last. Found with llvm static analyzer. --- modules/m_who.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/m_who.c b/modules/m_who.c index 63fb2ed..b8ffc87 100644 --- a/modules/m_who.c +++ b/modules/m_who.c @@ -442,7 +442,7 @@ append_format(char *buf, size_t bufsize, size_t *pos, const char *fmt, ...) max = *pos >= bufsize ? 0 : bufsize - *pos; va_start(ap, fmt); - result = rb_vsnprintf(buf + *pos, bufsize - *pos, fmt, ap); + result = rb_vsnprintf(buf + *pos, max, fmt, ap); va_end(ap); *pos += result; }