From fae112a8af5eae8248c6814fdc51cfc1dbc07e35 Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Fri, 22 Feb 2013 18:31:31 +0000 Subject: [PATCH] increase string size by one byte to accomodate the terminating null character in fscanf() since the maximum field width does not include it closes #3636 hat tip: Will Fiveash --- smime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smime.c b/smime.c index e62f30a29..2ee7b4a1a 100644 --- a/smime.c +++ b/smime.c @@ -357,7 +357,7 @@ char* smime_ask_for_key (char *prompt, char *mailbox, short public) char index_file[_POSIX_PATH_MAX]; FILE *index; char buf[LONG_STRING]; - char fields[5][STRING]; + char fields[5][STRING+1]; /* +1 due to use of fscanf() below. the max field width does not include the null terminator (see http://dev.mutt.org/trac/ticket/3636) */ int numFields, hash_suffix, done, cur; /* The current entry */ MUTTMENU* menu; unsigned int hash; @@ -470,7 +470,7 @@ char *smime_get_field_from_db (char *mailbox, char *query, short public, short m int addr_len, query_len, found = 0, ask = 0, choice = 0; char cert_path[_POSIX_PATH_MAX]; char buf[LONG_STRING], prompt[STRING]; - char fields[5][STRING]; + char fields[5][STRING+1]; /* +1 due to use of fscanf() below. the max field width does not include the null terminator (see http://dev.mutt.org/trac/ticket/3636) */ char key[STRING]; int numFields; struct stat info; -- 2.40.0