From: Brendan Cully Date: Mon, 7 May 2007 18:19:15 +0000 (-0700) Subject: Use signed arithmetic in mutt_gecos_name to avoid an overflow. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dad60f0a9ea66c9931743349330c8b6bfb053b90;p=neomutt Use signed arithmetic in mutt_gecos_name to avoid an overflow. Closes #2885. --- diff --git a/ChangeLog b/ChangeLog index dc4684502..7039481da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-05-02 10:50 -0700 N.J. Mann (f6861b85f22b) + + * OPS, curs_main.c, functions.h: Add next-folder command + +2007-05-01 10:41 -0700 Brendan Cully (1ed1cbc7bad4) + + * configure.ac: Make IDN depend on iconv support + 2007-04-29 19:10 -0700 Alain Bench (0e32bd00f341) * contrib/smime.rc, smime.c: contrib/smime.rc: diff --git a/muttlib.c b/muttlib.c index 9167f7e53..497b5f8b0 100644 --- 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]); }