]> jfr.im git - irc/charybdis-ircd/charybdis.git/commitdiff
ircd: use correct buffer sizes
authorSimon Arlott <sa.me.uk>
Thu, 18 Jan 2018 21:33:26 +0000 (21:33 +0000)
committerSimon Arlott <sa.me.uk>
Thu, 18 Jan 2018 21:35:33 +0000 (21:35 +0000)
This fixes an issue with truncated SJOINs.

ircd/s_serv.c

index df9d42bc393d3f40b2c9bf93062d80077b0f6edb..6d75f93fcad94a3d2037ba63bdcfec999192c54a 100644 (file)
@@ -57,7 +57,7 @@ int MaxConnectionCount = 1;
 int MaxClientCount = 1;
 int refresh_user_links = 0;
 
-static char buf[EXT_BUFSIZE];
+static char buf[BUFSIZE];
 
 /*
  * list of recognized server capabilities.  "TS" is not on the list
@@ -506,7 +506,7 @@ burst_ban(struct Client *client_p)
                         * to other servers, so rewrite to our server
                         * name.
                         */
-                       rb_strlcpy(operbuf, aconf->info.oper, sizeof buf);
+                       rb_strlcpy(operbuf, aconf->info.oper, sizeof operbuf);
                        p = strrchr(operbuf, '{');
                        if (p != NULL &&
                                        operbuf + sizeof operbuf - p > (ptrdiff_t)(melen + 2))
@@ -559,7 +559,7 @@ burst_modes_TS6(struct Client *client_p, struct Channel *chptr,
                tlen = strlen(banptr->banstr) + (banptr->forward ? strlen(banptr->forward) + 1 : 0) + 1;
 
                /* uh oh */
-               if(cur_len + tlen > EXT_BUFSIZE - 3)
+               if(cur_len + tlen > BUFSIZE - 3)
                {
                        /* the one we're trying to send doesnt fit at all! */
                        if(cur_len == mlen)
@@ -601,7 +601,7 @@ burst_modes_TS6(struct Client *client_p, struct Channel *chptr,
 static void
 burst_TS6(struct Client *client_p)
 {
-       char ubuf[EXT_BUFSIZE];
+       char ubuf[BUFSIZE];
        struct Client *target_p;
        struct Channel *chptr;
        struct membership *msptr;
@@ -698,7 +698,7 @@ burst_TS6(struct Client *client_p)
                        if(is_voiced(msptr))
                                tlen++;
 
-                       if(cur_len + tlen >= EXT_BUFSIZE - 3)
+                       if(cur_len + tlen >= BUFSIZE - 3)
                        {
                                *(t-1) = '\0';
                                sendto_one(client_p, "%s", buf);
@@ -764,7 +764,7 @@ burst_TS6(struct Client *client_p)
 const char *
 show_capabilities(struct Client *target_p)
 {
-       static char msgbuf[EXT_BUFSIZE];
+       static char msgbuf[BUFSIZE];
 
        *msgbuf = '\0';