This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Undernet IRC Server Source Code.".

The branch, u2_10_12_branch has been updated
       via  27bc52a63efed2c85b0a57b4a94d255d8c1384d7 (commit)
       via  2e60f7dbb5a148ce14c4b5bde2d4613bad6e63b3 (commit)
      from  3cce30c584d321f567ac390e93cce2a1d00ea825 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 27bc52a63efed2c85b0a57b4a94d255d8c1384d7
Author: Michael Poole <[email protected]>
Date:   Sun Jun 28 15:00:28 2020 -0400

    gline_stats: Pacify Coverity Scan
    
    It does not realize that both strlen(gl_user) <= USERLEN and also
    strlen(gl_host) <= HOSTLEN, and so gl_mask[] is always big enough.

diff --git a/ircd/gline.c b/ircd/gline.c
index d4cfe6e1..17ee7f0d 100644
--- a/ircd/gline.c
+++ b/ircd/gline.c
@@ -1163,16 +1163,16 @@ gline_stats(struct Client *sptr, const struct StatDesc 
*sd,
 {
   struct Gline *gline;
   struct Gline *sgline;
+  char gl_mask[USERLEN+HOSTLEN+2];
 
   gliter(GlobalGlineList, gline, sgline) {
     if (param) {
-      char gl_mask[USERLEN+HOSTLEN+2];
-      strcpy(gl_mask, gline->gl_user);
-      if (gline->gl_host) {
-       size_t len = strlen(gl_mask);
-       gl_mask[len++] = '@';
-       strcpy(gl_mask + len, gline->gl_host);
-      }
+      if (gline->gl_host)
+       ircd_snprintf(NULL, gl_mask, sizeof(gl_mask), "%s@%s",
+                     gline->gl_user, gline->gl_host);
+      else
+       ircd_strncpy(gl_mask, gline->gl_user, sizeof(gl_mask));
+
       if (mmatch(param, gl_mask))
        continue;
     }
commit 2e60f7dbb5a148ce14c4b5bde2d4613bad6e63b3
Author: Michael Poole <[email protected]>
Date:   Sun Jun 28 14:59:33 2020 -0400

    uping_server: Avoid overrunning destination server name
    
    Everyone knows better than to have a server name longer than HOSTLEN, but
    just in case someone does not, we should be careful.

diff --git a/ircd/uping.c b/ircd/uping.c
index 62b69560..f264400c 100644
--- a/ircd/uping.c
+++ b/ircd/uping.c
@@ -415,7 +415,7 @@ int uping_server(struct Client* sptr, struct ConfItem* 
aconf, int port, int coun
   pptr->count               = IRCD_MIN(20, count);
   pptr->client              = sptr;
   pptr->freeable            = UPING_PENDING_SOCKET;
-  strcpy(pptr->name, aconf->name);
+  ircd_strncpy(pptr->name, aconf->name, sizeof(pptr->name));
 
   pptr->next = pingList;
   pingList   = pptr;
-----------------------------------------------------------------------

Summary of changes:
 ircd/gline.c | 14 +++++++-------
 ircd/uping.c |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
Undernet IRC Server Source Code.
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to