import mutt-1.10.1-2.el8

This commit is contained in:
CentOS Sources 2019-11-05 14:45:30 -05:00 committed by Andrew Lukoshko
parent bf5f6a11b5
commit d180606063
16 changed files with 383 additions and 1 deletions

View File

@ -0,0 +1,21 @@
diff -up mutt-1.10.1/mbox.c.mutt-1.9.3-1_coverity_120_121 mutt-1.10.1/mbox.c
--- mutt-1.10.1/mbox.c.mutt-1.9.3-1_coverity_120_121 2018-11-26 10:42:53.503200044 +0100
+++ mutt-1.10.1/mbox.c 2018-11-26 10:43:37.491846848 +0100
@@ -1086,6 +1086,8 @@ static int mbox_sync_mailbox (CONTEXT *c
mutt_unblock_signals ();
mx_fastclose_mailbox (ctx);
mutt_pretty_mailbox (savefile, sizeof (savefile));
+ FREE (&newOffset);
+ FREE (&oldOffset);
mutt_error (_("Write failed! Saved partial mailbox to %s"), savefile);
mutt_sleep (5);
return (-1);
@@ -1100,6 +1102,8 @@ static int mbox_sync_mailbox (CONTEXT *c
unlink (tempfile);
mutt_unblock_signals ();
mx_fastclose_mailbox (ctx);
+ FREE (&newOffset);
+ FREE (&oldOffset);
mutt_error _("Fatal error! Could not reopen mailbox!");
return (-1);
}

View File

@ -0,0 +1,19 @@
diff -up mutt-1.10.1/pgp.c.mutt-1.9.3-1_coverity_159_160 mutt-1.10.1/pgp.c
--- mutt-1.10.1/pgp.c.mutt-1.9.3-1_coverity_159_160 2018-11-26 11:25:30.619922166 +0100
+++ mutt-1.10.1/pgp.c 2018-11-26 11:30:32.452320004 +0100
@@ -982,6 +982,7 @@ BODY *pgp_decrypt_part (BODY *a, STATE *
{
mutt_error _("Decryption failed");
pgp_void_passphrase ();
+ safe_fclose (&pgperr);
return NULL;
}
@@ -1471,6 +1472,7 @@ BODY *pgp_encrypt_message (BODY *a, char
fileno (fpout), fileno (pgperr),
pgpinfile, keylist, sign)) == -1)
{
+ safe_fclose (&fpout);
safe_fclose (&pgperr);
unlink(pgpinfile);
return (NULL);

View File

@ -0,0 +1,30 @@
diff -up mutt-1.10.1/pgpewrap.c.mutt-1.9.3-1_coverity_161 mutt-1.10.1/pgpewrap.c
--- mutt-1.10.1/pgpewrap.c.mutt-1.9.3-1_coverity_161 2018-11-26 11:34:45.733027391 +0100
+++ mutt-1.10.1/pgpewrap.c 2018-11-26 11:36:14.650319151 +0100
@@ -26,12 +26,6 @@ int main(int argc, char **argv) {
print_usage(argv[0]);
}
- opts = malloc((2 * argc + 1) * sizeof (* opts)); /* __MEM_CHECKED__ */
- if(!opts) {
- perror(argv[0]);
- exit(2);
- }
-
if (argc < 2)
{
fprintf (stderr,
@@ -40,6 +34,13 @@ int main(int argc, char **argv) {
return 1;
}
+ opts = malloc((2 * argc + 1) * sizeof (* opts)); /* __MEM_CHECKED__ */
+ if(!opts) {
+ perror(argv[0]);
+ exit(2);
+ }
+
+
opt = opts;
*opt++ = argv[1];
pfx = NULL;

View File

@ -0,0 +1,11 @@
diff -up mutt-1.10.1/query.c.mutt-1.9.3-1_coverity_166 mutt-1.10.1/query.c
--- mutt-1.10.1/query.c.mutt-1.9.3-1_coverity_166 2018-11-26 11:54:55.078468192 +0100
+++ mutt-1.10.1/query.c 2018-11-26 11:55:12.035710707 +0100
@@ -443,6 +443,7 @@ static void query_menu (char *buf, size_
}
mutt_create_alias (NULL, naddr);
+ rfc822_free_address (&naddr);
}
else
{

View File

@ -0,0 +1,20 @@
diff -up mutt-1.10.1/attach.c.mutt-1.9.3-1_coverity_17 mutt-1.10.1/attach.c
--- mutt-1.10.1/attach.c.mutt-1.9.3-1_coverity_17 2018-10-25 14:32:25.267823534 +0200
+++ mutt-1.10.1/attach.c 2018-10-25 14:33:07.644435674 +0200
@@ -47,13 +47,15 @@ int mutt_get_tmp_attachment (BODY *a)
{
char type[STRING];
char tempfile[_POSIX_PATH_MAX];
- rfc1524_entry *entry = rfc1524_new_entry();
+ rfc1524_entry *entry = NULL;
FILE *fpin = NULL, *fpout = NULL;
struct stat st;
if(a->unlink)
return 0;
+ entry = rfc1524_new_entry();
+
snprintf(type, sizeof(type), "%s/%s", TYPE(a), a->subtype);
rfc1524_mailcap_lookup(a, type, entry, 0);
rfc1524_expand_filename(entry->nametemplate, a->filename,

View File

@ -0,0 +1,12 @@
diff -up mutt-1.10.1/recvcmd.c.mutt-1.9.3-1_coverity_174 mutt-1.10.1/recvcmd.c
--- mutt-1.10.1/recvcmd.c.mutt-1.9.3-1_coverity_174 2018-11-26 12:02:13.755647167 +0100
+++ mutt-1.10.1/recvcmd.c 2018-11-26 12:02:36.240969591 +0100
@@ -445,7 +445,7 @@ static void attach_forward_bodies (FILE
if ((tmpfp = safe_fopen (tmpbody, "w")) == NULL)
{
mutt_error (_("Can't open temporary file %s."), tmpbody);
- return;
+ goto bail;
}
mutt_forward_intro (Context, parent_hdr, tmpfp);

View File

@ -0,0 +1,12 @@
diff -up mutt-1.10.1/send.c.mutt-1.9.3-1_coverity_181 mutt-1.10.1/send.c
--- mutt-1.10.1/send.c.mutt-1.9.3-1_coverity_181 2018-11-26 12:08:42.615216677 +0100
+++ mutt-1.10.1/send.c 2018-11-26 12:08:52.007351542 +0100
@@ -243,7 +243,7 @@ static int edit_envelope (ENVELOPE *en)
if (ascii_strncasecmp ("subject:", uh->data, 8) == 0)
{
p = skip_email_wsp(uh->data + 8);
- strncpy (buf, p, sizeof (buf));
+ strfcpy (buf, p, sizeof (buf));
}
}
}

View File

@ -0,0 +1,31 @@
diff -up mutt-1.10.1/sendlib.c.mutt-1.9.3-1_coverity_187_188_189_190 mutt-1.10.1/sendlib.c
--- mutt-1.10.1/sendlib.c.mutt-1.9.3-1_coverity_187_188_189_190 2018-11-26 12:34:51.007894823 +0100
+++ mutt-1.10.1/sendlib.c 2018-11-26 12:35:08.374143006 +0100
@@ -1815,11 +1815,15 @@ static int write_one_header (FILE *fp, i
NONULL(pfx), valbuf, max, wraplen));
if (pfx && *pfx)
if (fputs (pfx, fp) == EOF)
+ {
+ FREE(&valbuf);
return -1;
+ }
if (!(t = strchr (valbuf, ':')))
{
dprint (1, (debugfile, "mwoh: warning: header not in "
"'key: value' format!\n"));
+ FREE(&valbuf);
return 0;
}
if (print_val (fp, pfx, valbuf, flags, mutt_strlen (pfx)) < 0)
@@ -1861,7 +1865,11 @@ static int write_one_header (FILE *fp, i
"max width = %d > %d\n",
NONULL(pfx), valbuf, max, wraplen));
if (fold_one_header (fp, tagbuf, valbuf, pfx, wraplen, flags) < 0)
+ {
+ FREE (&tagbuf);
+ FREE (&valbuf);
return -1;
+ }
FREE (&tagbuf);
FREE (&valbuf);
}

View File

@ -0,0 +1,12 @@
diff -up mutt-1.10.1/sendlib.c.mutt-1.9.3-1_coverity_197 mutt-1.10.1/sendlib.c
--- mutt-1.10.1/sendlib.c.mutt-1.9.3-1_coverity_197 2018-11-26 13:57:05.191252870 +0100
+++ mutt-1.10.1/sendlib.c 2018-11-26 13:57:50.489896425 +0100
@@ -2806,6 +2806,8 @@ int mutt_write_fcc (const char *path, HE
if ((msg = mx_open_new_message (&f, hdr, onm_flags)) == NULL)
{
mx_close_mailbox (&f, NULL);
+ safe_fclose (&tempfp);
+ unlink (tempfile);
return (-1);
}

View File

@ -0,0 +1,27 @@
diff -up mutt-1.10.1/smime.c.mutt-1.9.3-1_coverity_199_200_201 mutt-1.10.1/smime.c
--- mutt-1.10.1/smime.c.mutt-1.9.3-1_coverity_199_200_201 2018-11-26 14:05:07.405126055 +0100
+++ mutt-1.10.1/smime.c 2018-11-26 14:05:23.436356595 +0100
@@ -1873,6 +1873,7 @@ static BODY *smime_handle_entity (BODY *
fileno (smimeout), fileno (smimeerr), tmpfname)) == -1)
{
safe_fclose (&smimeout); smimeout = NULL;
+ safe_fclose (&smimeerr);
mutt_unlink (tmpfname);
if (s->flags & MUTT_DISPLAY)
state_attach_puts (_("[-- Error: unable to create OpenSSL subprocess! --]\n"), s);
@@ -1884,6 +1885,7 @@ static BODY *smime_handle_entity (BODY *
tmpfname, SIGNOPAQUE)) == -1)
{
safe_fclose (&smimeout); smimeout = NULL;
+ safe_fclose (&smimeerr);
mutt_unlink (tmpfname);
if (s->flags & MUTT_DISPLAY)
state_attach_puts (_("[-- Error: unable to create OpenSSL subprocess! --]\n"), s);
@@ -1939,6 +1941,7 @@ static BODY *smime_handle_entity (BODY *
{
mutt_perror(tmptmpfname);
safe_fclose (&smimeout); smimeout = NULL;
+ safe_fclose (&smimeerr);
return NULL;
}
}

View File

@ -0,0 +1,28 @@
diff -up mutt-1.10.1/crypt-gpgme.c.mutt-1.9.3-1_coverity_76 mutt-1.10.1/crypt-gpgme.c
--- mutt-1.10.1/crypt-gpgme.c.mutt-1.9.3-1_coverity_76 2018-10-25 14:45:49.563438618 +0200
+++ mutt-1.10.1/crypt-gpgme.c 2018-10-25 14:51:49.293461260 +0200
@@ -562,6 +562,7 @@ static char *data_object_to_tempfile (gp
char tempfb[_POSIX_PATH_MAX];
FILE *fp;
size_t nread = 0;
+ char * ret = NULL;
if (!tempf)
{
@@ -604,7 +605,15 @@ static char *data_object_to_tempfile (gp
}
if (ret_fp)
*ret_fp = fp;
- return safe_strdup (tempf);
+
+ if ((ret = safe_strdup (tempf)) == NULL)
+ {
+ mutt_perror _("Can't allocate memory!");
+ unlink (tempf);
+ safe_fclose (&fp);
+ return NULL;
+ }
+ return ret;
}

View File

@ -0,0 +1,66 @@
diff -up mutt-1.10.1/hcache.c.mutt-1.9.3-1_coverity_81_82_83 mutt-1.10.1/hcache.c
--- mutt-1.10.1/hcache.c.mutt-1.9.3-1_coverity_81_82_83 2018-10-25 15:24:29.323623566 +0200
+++ mutt-1.10.1/hcache.c 2018-10-25 15:27:41.932438843 +0200
@@ -842,7 +842,7 @@ mutt_hcache_fetch_raw (header_cache_t *h
return data.data;
#else
- strncpy(path, h->folder, sizeof (path));
+ strfcpy(path, h->folder, sizeof (path));
safe_strcat(path, sizeof (path), filename);
ksize = strlen (h->folder) + keylen (path + strlen (h->folder));
@@ -944,7 +944,7 @@ mutt_hcache_store_raw (header_cache_t* h
return h->db->put(h->db, NULL, &key, &databuf, 0);
#else
- strncpy(path, h->folder, sizeof (path));
+ strfcpy(path, h->folder, sizeof (path));
safe_strcat(path, sizeof (path), filename);
ksize = strlen(h->folder) + keylen(path + strlen(h->folder));
@@ -1042,7 +1042,7 @@ mutt_hcache_delete(header_cache_t *h, co
if (!h)
return -1;
- strncpy(path, h->folder, sizeof (path));
+ strfcpy(path, h->folder, sizeof (path));
safe_strcat(path, sizeof (path), filename);
ksize = strlen(h->folder) + keylen(path + strlen(h->folder));
@@ -1100,7 +1100,7 @@ mutt_hcache_delete(header_cache_t *h, co
if (!h)
return -1;
- strncpy(path, h->folder, sizeof (path));
+ strfcpy(path, h->folder, sizeof (path));
safe_strcat(path, sizeof (path), filename);
ksize = strlen(h->folder) + keylen(path + strlen(h->folder));
@@ -1161,7 +1161,7 @@ mutt_hcache_delete(header_cache_t *h, co
if (!h)
return -1;
- strncpy(path, h->folder, sizeof (path));
+ strfcpy(path, h->folder, sizeof (path));
safe_strcat(path, sizeof (path), filename);
ksize = strlen(h->folder) + keylen(path + strlen(h->folder));
@@ -1211,7 +1211,7 @@ mutt_hcache_delete(header_cache_t *h, co
if (!h)
return -1;
- strncpy(path, h->folder, sizeof (path));
+ strfcpy(path, h->folder, sizeof (path));
safe_strcat(path, sizeof (path), filename);
key.dptr = path;
@@ -1417,7 +1417,7 @@ mutt_hcache_delete(header_cache_t *h, co
if (!h)
return -1;
- strncpy(path, h->folder, sizeof (path));
+ strfcpy(path, h->folder, sizeof (path));
safe_strcat(path, sizeof (path), filename);
ksize = strlen (h->folder) + keylen (path + strlen (h->folder));

View File

@ -0,0 +1,12 @@
diff -up mutt-1.10.1/headers.c.mutt-1.9.3-1_coverity_86 mutt-1.10.1/headers.c
--- mutt-1.10.1/headers.c.mutt-1.9.3-1_coverity_86 2018-10-25 15:29:53.080447423 +0200
+++ mutt-1.10.1/headers.c 2018-10-25 15:30:07.509671538 +0200
@@ -60,6 +60,8 @@ void mutt_edit_headers (const char *edit
if ((ifp = fopen (body, "r")) == NULL)
{
mutt_perror (body);
+ safe_fclose (&ifp);
+ safe_fclose (&ofp);
return;
}

View File

@ -0,0 +1,12 @@
diff -up mutt-1.10.1/headers.c.mutt-1.9.3-1_coverity_87 mutt-1.10.1/headers.c
--- mutt-1.10.1/headers.c.mutt-1.9.3-1_coverity_87 2018-10-25 15:31:00.153489193 +0200
+++ mutt-1.10.1/headers.c 2018-10-25 15:31:22.142823598 +0200
@@ -283,7 +283,7 @@ int mutt_label_message(HEADER *hdr)
*buf = '\0';
if (hdr != NULL && hdr->env->x_label != NULL) {
- strncpy(buf, hdr->env->x_label, LONG_STRING);
+ strfcpy(buf, hdr->env->x_label, LONG_STRING);
}
if (mutt_get_field("Label: ", buf, sizeof(buf), MUTT_LABEL /* | MUTT_CLEAR */) != 0)

View File

@ -0,0 +1,30 @@
diff -up mutt-1.10.1/imap/auth_gss.c.mutt-1.9.3-1_coverity_88_89 mutt-1.10.1/imap/auth_gss.c
--- mutt-1.10.1/imap/auth_gss.c.mutt-1.9.3-1_coverity_88_89 2018-10-25 15:32:18.258644709 +0200
+++ mutt-1.10.1/imap/auth_gss.c 2018-10-25 15:33:10.744412689 +0200
@@ -71,7 +71,7 @@ static void print_gss_error(OM_uint32 er
status_len = status_string.length;
if (status_len >= sizeof(buf_maj))
status_len = sizeof(buf_maj) - 1;
- strncpy(buf_maj, (char*) status_string.value, status_len);
+ strfcpy(buf_maj, (char*) status_string.value, status_len);
buf_maj[status_len] = '\0';
gss_release_buffer(&min_stat, &status_string);
@@ -86,7 +86,7 @@ static void print_gss_error(OM_uint32 er
status_len = status_string.length;
if (status_len >= sizeof(buf_min))
status_len = sizeof(buf_min) - 1;
- strncpy(buf_min, (char*) status_string.value, status_len);
+ strfcpy(buf_min, (char*) status_string.value, status_len);
buf_min[status_len] = '\0';
gss_release_buffer(&min_stat, &status_string);
}
@@ -273,7 +273,7 @@ imap_auth_res_t imap_auth_gss (IMAP_DATA
memcpy (buf1, &buf_size, 4);
buf1[0] = GSS_AUTH_P_NONE;
/* server decides if principal can log in as user */
- strncpy (buf1 + 4, idata->conn->account.user, sizeof (buf1) - 4);
+ strfcpy (buf1 + 4, idata->conn->account.user, sizeof (buf1) - 4);
request_buf.value = buf1;
request_buf.length = 4 + strlen (idata->conn->account.user);
maj_stat = gss_wrap (&min_stat, context, 0, GSS_C_QOP_DEFAULT, &request_buf,

View File

@ -20,7 +20,7 @@
Summary: A text mode mail user agent
Name: mutt
Version: 1.10.1
Release: 1%{?dist}
Release: 2%{?dist}
Epoch: 5
# The entire source code is GPLv2+ except
# pgpewrap.c setenv.c sha1.c wcwidth.c which are Public Domain
@ -38,6 +38,25 @@ Patch8: mutt-1.5.23-system_certs.patch
Patch9: mutt-1.9.0-ssl_ciphers.patch
Patch10: mutt-1.9.4-lynx_no_backscapes.patch
Patch12: mutt-1.9.5-nodotlock.patch
# Coverity patches
# https://cov01.lab.eng.brq.redhat.com/el8-results/el8/mutt-1.9.3-1.el8+7/scan-results-imp.html
Patch101: mutt-1.10.1-mutt-1.9.3-1_coverity_17.patch
Patch102: mutt-1.10.1-mutt-1.9.3-1_coverity_76.patch
Patch103: mutt-1.10.1-mutt-1.9.3-1_coverity_81_82_83.patch
Patch104: mutt-1.10.1-mutt-1.9.3-1_coverity_86.patch
Patch105: mutt-1.10.1-mutt-1.9.3-1_coverity_87.patch
Patch106: mutt-1.10.1-mutt-1.9.3-1_coverity_88_89.patch
Patch107: mutt-1.10.1-mutt-1.9.3-1_coverity_120_121.patch
Patch108: mutt-1.10.1-mutt-1.9.3-1_coverity_159_160.patch
Patch110: mutt-1.10.1-mutt-1.9.3-1_coverity_161.patch
Patch111: mutt-1.10.1-mutt-1.9.3-1_coverity_166.patch
Patch112: mutt-1.10.1-mutt-1.9.3-1_coverity_174.patch
Patch113: mutt-1.10.1-mutt-1.9.3-1_coverity_181.patch
Patch114: mutt-1.10.1-mutt-1.9.3-1_coverity_187_188_189_190.patch
Patch115: mutt-1.10.1-mutt-1.9.3-1_coverity_197.patch
Patch116: mutt-1.10.1-mutt-1.9.3-1_coverity_199_200_201.patch
Url: http://www.mutt.org
Requires: mailcap, urlview
BuildRequires: gcc
@ -91,6 +110,22 @@ autoreconf --install
%patch8 -p1 -b .system_certs
%patch9 -p1 -b .ssl_ciphers
%patch101 -p1 -b .mutt-1.9.3-1_coverity_17
%patch102 -p1 -b .mutt-1.9.3-1_coverity_76
%patch103 -p1 -b .mutt-1.9.3-1_coverity_81_82_83
%patch104 -p1 -b .mutt-1.9.3-1_coverity_86
%patch105 -p1 -b .mutt-1.9.3-1_coverity_87
%patch106 -p1 -b .mutt-1.9.3-1_coverity_88_89
%patch107 -p1 -b .mutt-1.9.3-1_coverity_120_121
%patch108 -p1 -b .mutt-1.9.3-1_coverity_159_160
%patch110 -p1 -b .mutt-1.9.3-1_coverity_161
%patch111 -p1 -b .mutt-1.9.3-1_coverity_166
%patch112 -p1 -b .mutt-1.9.3-1_coverity_174
%patch113 -p1 -b .mutt-1.9.3-1_coverity_181
%patch114 -p1 -b .mutt-1.9.3-1_coverity_187_188_189_190.patch
%patch115 -p1 -b .mutt-1.9.3-1_coverity_197
%patch116 -p1 -b .mutt-1.9.3-1_coverity_199_200_201
sed -i -r 's/`$GPGME_CONFIG --libs`/"\0 -lgpg-error"/' configure
install -p -m644 %{SOURCE1} mutt_ldap_query
@ -204,6 +239,10 @@ ln -sf ./muttrc.5 %{buildroot}%{_mandir}/man5/muttrc.local.5
%changelog
* Thu Jun 13 2019 Matej Mužila <mmuzila@redhat.com> - 5:1.10.1-2
- Fix Coverity issues
- Resolves: #1602622
* Tue Jul 17 2018 Matej Mužila <mmuzila@redhat.com> - 5:1.10.1-1
- Upgrade to 1.10.1