Fic bug boo#1061343

OBS-URL: https://build.opensuse.org/package/show/server:mail/mutt?expand=0&rev=177
This commit is contained in:
Dr. Werner Fink 2017-10-04 07:57:08 +00:00 committed by Git OBS Bridge
parent 70b89239e3
commit fcd2204ae8
3 changed files with 112 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Oct 4 07:55:59 UTC 2017 - werner@suse.de
- Add patch neomutt-c030a8b.patch from upstream commit to fix
boo#1061343
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Sep 15 09:07:55 UTC 2017 - werner@suse.de Fri Sep 15 09:07:55 UTC 2017 - werner@suse.de

View File

@ -99,6 +99,8 @@ Patch16: mutt-1.5.23-carriage-return.path
Patch18: mutt-1.5.21-mailcap.diff Patch18: mutt-1.5.21-mailcap.diff
# PATCH-FIX-SUSE: bsc#907453 - CVE-2014-9116: mutt: heap-based buffer overflow in mutt_substrdup() # PATCH-FIX-SUSE: bsc#907453 - CVE-2014-9116: mutt: heap-based buffer overflow in mutt_substrdup()
Patch19: bsc907453-CVE-2014-9116-jessie.patch Patch19: bsc907453-CVE-2014-9116-jessie.patch
# PATCH-FIX-UPSTREAM: bsc#1061343 - (neo)mutt displaying times in Zulu time
Patch20: neomutt-c030a8b.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%global _sysconfdir %{_sysconfdir} %global _sysconfdir %{_sysconfdir}
@ -145,6 +147,7 @@ ln -sf neomutt-neomutt-%neo mutt-%version
%patch16 -p0 -b .crlf %patch16 -p0 -b .crlf
%patch18 -p0 -b .mailcap %patch18 -p0 -b .mailcap
%patch19 -p0 -b .cvw2014.9116 %patch19 -p0 -b .cvw2014.9116
%patch20 -p1 -b .zulu
rm -vf README*.orig rm -vf README*.orig
rm -vf PATCHES*.orig rm -vf PATCHES*.orig

103
neomutt-c030a8b.patch Normal file
View File

@ -0,0 +1,103 @@
From c030a8b8ef43f2bc549e4f00651c25681d54f26e Mon Sep 17 00:00:00 2001
From: Richard Russon <rich@flatcap.org>
Date: Thu, 14 Sep 2017 17:36:19 +0100
Subject: [PATCH] fix: %{fmt} date format
A mistake was introduced when moving the date code to the library.
The dates being displayed were those of the base timezone, not the email.
Remove the `%<...>` documentation from `$index_format`
Fixes #757
---
init.h | 2 --
lib/date.c | 12 ++++++++----
lib/date.h | 2 +-
parse.c | 10 +++++-----
4 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/init.h b/init.h
index 247b0f211..4f029f39c 100644
--- a/init.h
+++ b/init.h
@@ -1584,8 +1584,6 @@ struct Option MuttVars[] = {
** .dt %(fmt) .dd the local date and time when the message was received.
** ``fmt'' is expanded by the library function \fCstrftime(3)\fP;
** a leading bang disables locales
- ** .dt %<fmt> .dd the current local time. ``fmt'' is expanded by the library
- ** function \fCstrftime(3)\fP; a leading bang disables locales.
** .dt %>X .dd right justify the rest of the string and pad with character ``X''
** .dt %|X .dd pad to the end of the line with character ``X''
** .dt %*X .dd soft-fill with character ``X'' as pad
diff --git a/lib/date.c b/lib/date.c
index b1a450a24..5cce4b3f9 100644
--- a/lib/date.c
+++ b/lib/date.c
@@ -432,7 +432,7 @@ bool is_day_name(const char *s)
*
* The 'timezone' field is optional; it defaults to +0000 if missing.
*/
-time_t mutt_parse_date(const char *s, const struct Tz **tz_out)
+time_t mutt_parse_date(const char *s, struct Tz *tz_out)
{
int count = 0;
char *t = NULL;
@@ -537,9 +537,6 @@ time_t mutt_parse_date(const char *s, const struct Tz **tz_out)
zhours = tz->zhours;
zminutes = tz->zminutes;
zoccident = tz->zoccident;
-
- if (tz_out)
- *tz_out = tz;
}
/* ad hoc support for the European MET (now officially CET) TZ */
@@ -568,5 +565,12 @@ time_t mutt_parse_date(const char *s, const struct Tz **tz_out)
return -1;
}
+ if (tz_out)
+ {
+ tz_out->zhours = zhours;
+ tz_out->zminutes = zminutes;
+ tz_out->zoccident = zoccident;
+ }
+
return (mutt_mktime(&tm, 0) + tz_offset);
}
diff --git a/lib/date.h b/lib/date.h
index ad0eb9c38..fab7a1b8f 100644
--- a/lib/date.h
+++ b/lib/date.h
@@ -45,7 +45,7 @@ time_t mutt_local_tz(time_t t);
time_t mutt_mktime(struct tm *t, int local);
void mutt_normalize_time(struct tm *tm);
char *mutt_make_date(char *buf, size_t buflen);
-time_t mutt_parse_date(const char *s, const struct Tz **tz_out);
+time_t mutt_parse_date(const char *s, struct Tz *tz_out);
bool is_day_name(const char *s);
int mutt_check_month(const char *s);
diff --git a/parse.c b/parse.c
index 38f46129d..3b8966e1a 100644
--- a/parse.c
+++ b/parse.c
@@ -835,13 +835,13 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line,
mutt_str_replace(&e->date, p);
if (hdr)
{
- const struct Tz *tz = NULL;
+ struct Tz tz;
hdr->date_sent = mutt_parse_date(p, &tz);
- if (tz)
+ if (hdr->date_sent > 0)
{
- hdr->zhours = tz->zhours;
- hdr->zminutes = tz->zminutes;
- hdr->zoccident = tz->zoccident;
+ hdr->zhours = tz.zhours;
+ hdr->zminutes = tz.zminutes;
+ hdr->zoccident = tz.zoccident;
}
}
matched = 1;