Dr. Werner Fink 2013-04-22 09:36:06 +00:00 committed by Git OBS Bridge
parent 830dd05dca
commit 81a8190f4d
3 changed files with 74 additions and 26 deletions

View File

@ -1,8 +1,8 @@
-------------------------------------------------------------------
Thu Apr 18 12:54:39 UTC 2013 - werner@suse.de
- Add widechar.sidebar.dif: bnc#813498 - mutt crashes in fgetwc in
text_enriched_handler
- 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

View File

@ -133,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} \

View File

@ -1,22 +1,40 @@
--- handler.c
+++ handler.c 2013-04-18 12:51:41.414000078 +0000
@@ -1650,7 +1650,7 @@ int mutt_body_handler (BODY *b, STATE *s
/* decode to a tempfile, saving the original destination */
fp = s->fpout;
#ifdef HAVE_FMEMOPEN
- if ((s->fpout = open_memstream(&temp, &tempsize)) == NULL)
+ if ((s->fpout = open_wmemstream(&temp, &tempsize)) == NULL)
+++ handler.c
@@ -778,7 +778,7 @@ static void enriched_set_flags (const wchar_t *tag, struct enriched_state *stte)
static int text_enriched_handler (BODY *a, STATE *s)
{
mutt_error _("Unable to open memory stream!");
dprint (1, (debugfile, "Can't open memory stream.\n"));
--- pattern.c
+++ pattern.c 2013-04-18 12:52:06.573939217 +0000
@@ -168,7 +168,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat
s.fpin = msg->fp;
s.flags = M_CHARCONV;
#ifdef HAVE_FMEMOPEN
- if((s.fpout = open_memstream(&temp, &tempsize)) == NULL)
+ if((s.fpout = open_wmemstream(&temp, &tempsize)) == NULL)
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 *a, STATE *s)
{
mutt_perror ("Error opening memstream");
return (0);
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 *a, STATE *s)
switch (state)
{
+ case TEXT_GOTWC:
+ state = TEXT;
case TEXT :
switch (wc)
{
@@ -875,9 +877,8 @@ static int text_enriched_handler (BODY *a, STATE *s)
enriched_flush (&stte, 1);
else
{
- ungetwc (wc, s->fpin);
bytes++;
- state = TEXT;
+ state = TEXT_GOTWC;
}
break;