]> jfr.im git - solanum.git/commitdiff
chmode: Fix snprintf size
authorMatthew Martin <redacted>
Fri, 24 Jun 2022 04:38:52 +0000 (23:38 -0500)
committerDoug Freed <redacted>
Fri, 24 Jun 2022 05:42:08 +0000 (01:42 -0400)
ircd/chmode.c

index 41fe1c711aef19c21fc198572bba4711b6200bb8..2b9f48c57b5c4c2d2bd7747922b031d79d8f2a5c 100644 (file)
@@ -925,7 +925,7 @@ chm_ban(struct Client *source_p, struct Channel *chptr,
                }
 
                if (removed && removed->forward)
-                       removed_mask_pos += snprintf(buf + old_removed_mask_pos, sizeof(buf), "%s$%s", removed->banstr, removed->forward) + 1;
+                       removed_mask_pos += snprintf(buf + old_removed_mask_pos, sizeof(buf) - old_removed_mask_pos, "%s$%s", removed->banstr, removed->forward) + 1;
                else
                        removed_mask_pos += rb_strlcpy(buf + old_removed_mask_pos, mask, sizeof(buf)) + 1;
                if (removed)