diff --git a/mutt.changes b/mutt.changes index 087a6f4..31d0bf7 100644 --- a/mutt.changes +++ b/mutt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 18 12:54:39 UTC 2013 - werner@suse.de + +- Add widechar.sidebar.dif as workaround: bnc#813498 - mutt crashes + in fgetwc in text_enriched_handler + ------------------------------------------------------------------- Mon Jan 14 09:11:05 UTC 2013 - werner@suse.de diff --git a/mutt.spec b/mutt.spec index e2f093c..28e94b6 100644 --- a/mutt.spec +++ b/mutt.spec @@ -92,6 +92,8 @@ Patch11: aw.listreply.diff Patch12: patch-1.5.21.vk.pgp_verbose_mime Patch13: automake-1.12.patch Patch14: nion.sidebar-color.diff +# PATCH-FIX-OPENSUSE: bnc#813498 - mutt crashes in fgetwc in text_enriched_handler +Patch15: widechar.sidebar.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir %{_sysconfdir} @@ -122,6 +124,7 @@ done %patch12 -p1 -b .pgp_verbose_mtime %patch13 -p1 -b .automake-1.12 %patch14 -p1 -b .sidebar.color +%patch15 -p0 -b .widechar.sidebar cp doc/Muttrc Muttrc.SuSE cp %{S:2} . @@ -130,12 +133,42 @@ cp %{S:2} . %if 0%{?suse_version} > 1100 autoreconf -fi %endif + cflags () + { + local flag=$1; shift + local var=$1; shift + test -n "${flag}" -a -n "${var}" || return + case "${!var}" in + *${flag}*) return + esac + set -o noclobber + case "$flag" in + -Wl,*) + if echo 'int main () { return 0; }' | \ + ${CC:-gcc} -Werror $flag -o /dev/null -xc - > /dev/null 2>&1 ; then + eval $var=\${$var:+\$$var\ }$flag + fi + ;; + *) + if ${CC:-gcc} -Werror $flag -S -o /dev/null -xc /dev/null > /dev/null 2>&1 ; then + eval $var=\${$var:+\$$var\ }$flag + fi + esac + set +o noclobber + } CC=gcc -CFLAGS="-Wall $RPM_OPT_FLAGS -I. -D_GNU_SOURCE -fno-strict-aliasing" -CFLAGS="$CFLAGS -fstack-protector" -#CFLAGS="$CFLAGS -DSUSE_IMAP_FORCE_SSL" +CFLAGS="-Wall $RPM_OPT_FLAGS -I. -D_GNU_SOURCE" +#cflags -DSUSE_IMAP_FORCE_SSL CFLAGS +cflags -std=gnu99 CFLAGS +cflags -fno-strict-aliasing CFLAGS +cflags -fstack-protector CFLAGS +cflags -g3 CFLAGS +cflags -pipe CFLAGS +cflags -Wl,--as-needed LDFLAGS +cflags -Wl,-O2 LDFLAGS +cflags -Wl,--hash-size=8599 LDFLAGS KRB5CFGPATH=%{S:6} -export CC CFLAGS KRB5CFGPATH +export CC CFLAGS LDFLAGS KRB5CFGPATH chmod 755 $KRB5CFGPATH ./configure $RPM_ARCH-suse-linux \ --prefix=%{_prefix} \ diff --git a/widechar.sidebar.dif b/widechar.sidebar.dif new file mode 100644 index 0000000..a1fe972 --- /dev/null +++ b/widechar.sidebar.dif @@ -0,0 +1,66 @@ +--- handler.c ++++ handler.c 2013-04-22 00:00:00.000000000 +0000 +@@ -778,7 +778,7 @@ static void enriched_set_flags (const wc + static int text_enriched_handler (BODY *a, STATE *s) + { + enum { +- TEXT, LANGLE, TAG, BOGUS_TAG, NEWLINE, ST_EOF, DONE ++ TEXT, TEXT_GOTWC, LANGLE, TAG, BOGUS_TAG, NEWLINE, ST_EOF, DONE + } state = TEXT; + + long bytes = a->length; +@@ -807,7 +807,7 @@ static int text_enriched_handler (BODY * + { + if (state != ST_EOF) + { +- if (!bytes || (wc = fgetwc (s->fpin)) == WEOF) ++ if (state != TEXT_GOTWC && (!bytes || (fscanf (s->fpin, "%lc", &wc)) == EOF)) + state = ST_EOF; + else + bytes--; +@@ -815,6 +815,8 @@ static int text_enriched_handler (BODY * + + switch (state) + { ++ case TEXT_GOTWC: ++ state = TEXT; + case TEXT : + switch (wc) + { +@@ -875,9 +877,8 @@ static int text_enriched_handler (BODY * + enriched_flush (&stte, 1); + else + { +- ungetwc (wc, s->fpin); + bytes++; +- state = TEXT; ++ state = TEXT_GOTWC; + } + break; + +@@ -1490,7 +1491,7 @@ void mutt_decode_attachment (BODY *b, ST + * strip all trailing spaces to improve interoperability; + * if $text_flowed is unset, simply verbatim copy input + */ +-static int text_plain_handler (BODY *b, STATE *s) ++static int text_plain_handler (BODY *b __attribute__((unused)), STATE *s) + { + char *buf = NULL; + size_t l = 0, sz = 0; +@@ -1518,7 +1519,6 @@ int mutt_body_handler (BODY *b, STATE *s + int decode = 0; + int plaintext = 0; + FILE *fp = NULL; +- char tempfile[_POSIX_PATH_MAX]; + handler_t handler = NULL; + LOFF_T tmpoffset = 0; + size_t tmplength = 0; +@@ -1528,6 +1528,8 @@ int mutt_body_handler (BODY *b, STATE *s + #ifdef HAVE_FMEMOPEN + char *temp; + size_t tempsize; ++#else ++ char tempfile[_POSIX_PATH_MAX]; + #endif + + int oflags = s->flags;