]> diplodocus.org Git - nmh/commitdiff
Increased sizes of a couple of buffers.
authorDavid Levine <levinedl@acm.org>
Thu, 1 Nov 2018 23:44:32 +0000 (19:44 -0400)
committerDavid Levine <levinedl@acm.org>
Thu, 1 Nov 2018 23:44:32 +0000 (19:44 -0400)
gcc 8 noticed that snprintf could have overrun them.  It might be
better to reduce the sizes of buffers used for display names, etc.
Or ever better, use dynamically sized buffers.

sbr/mts.c
uip/replsbr.c

index 13c3a08a0fef18e494f3a51b7186f52356addb0b..452dc735058228f87961d95b0aff56ae11e40d25 100644 (file)
--- a/sbr/mts.c
+++ b/sbr/mts.c
@@ -54,7 +54,7 @@ char *spoollocking = DEFAULT_LOCKING;
 /* Cache the username, fullname, and mailbox of the user */
 static char username[BUFSIZ];
 static char fullname[BUFSIZ];
 /* Cache the username, fullname, and mailbox of the user */
 static char username[BUFSIZ];
 static char fullname[BUFSIZ];
-static char localmbox[BUFSIZ];
+static char localmbox[2*BUFSIZ+3];
 
 /*
  * MTS specific variables
 
 /*
  * MTS specific variables
index 55bcd6ceee9e829300dc243db3c502fa11b8b819..e3c88949111026ad61b09b08ecc70b062075dce9 100644 (file)
@@ -294,7 +294,7 @@ static char *
 replformataddr (char *orig, char *str)
 {
     int len;
 replformataddr (char *orig, char *str)
 {
     int len;
-    char baddr[BUFSIZ], error[BUFSIZ];
+    char baddr[BUFSIZ+6], error[BUFSIZ];
     bool isgroup;
     char *dst;
     char *cp;
     bool isgroup;
     char *dst;
     char *cp;