]> granicus.if.org Git - mutt/commitdiff
Use signed arithmetic in mutt_gecos_name to avoid an overflow.
authorBrendan Cully <brendan@kublai.com>
Mon, 7 May 2007 18:19:15 +0000 (11:19 -0700)
committerBrendan Cully <brendan@kublai.com>
Mon, 7 May 2007 18:19:15 +0000 (11:19 -0700)
Closes #2885.

ChangeLog
muttlib.c

index dc46845024fb25adee3495bac93b6f4153126017..7039481dadd9fd38ccd9d85a1e7ed25f242c9472 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-05-02 10:50 -0700  N.J. Mann  <njm@njm.f2s.com>  (f6861b85f22b)
+
+       * OPS, curs_main.c, functions.h: Add next-folder command
+
+2007-05-01 10:41 -0700  Brendan Cully  <brendan@kublai.com>  (1ed1cbc7bad4)
+
+       * configure.ac: Make IDN depend on iconv support
+
 2007-04-29 19:10 -0700  Alain Bench  <veronatif@free.fr>  (0e32bd00f341)
 
        * contrib/smime.rc, smime.c: contrib/smime.rc:
index 9167f7e53f3986c86c57a852fb7ae875b1cecdc4..497b5f8b08550397b52f21efddc289522193eb79 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -540,7 +540,7 @@ char *mutt_gecos_name (char *dest, size_t destlen, struct passwd *pw)
     if (dest[idx] == '&')
     {
       memmove (&dest[idx + pwnl], &dest[idx + 1],
-              MAX(destlen - idx - pwnl - 1, 0));
+              MAX((ssize_t)(destlen - idx - pwnl - 1), 0));
       memcpy (&dest[idx], pw->pw_name, MIN(destlen - idx - 1, pwnl));
       dest[idx] = toupper ((unsigned char) dest[idx]);
     }