From 2ecaea82a8f9758da5a38cb5df98fbde188d92ba Mon Sep 17 00:00:00 2001 From: David Levine Date: Mon, 31 Oct 2016 15:03:07 -0400 Subject: [PATCH] Don't set CT type if reformat failed. --- test/mhfixmsg/test-mhfixmsg | 3 ++- uip/mhfixmsg.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/mhfixmsg/test-mhfixmsg b/test/mhfixmsg/test-mhfixmsg index b3177dbc..a95ef3f2 100755 --- a/test/mhfixmsg/test-mhfixmsg +++ b/test/mhfixmsg/test-mhfixmsg @@ -1072,6 +1072,7 @@ fi # check handling of rfc822 message type +# also, checks -fixboundary start_test "handling of rfc822 message type" cat >"$expected" < @@ -1109,7 +1110,7 @@ Date: Fri, 29 Sep 2006 00:00:00 Message-Id: @test.nmh Subject: message with message/rfc822 attachment MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaa0" +Content-Type: multipart/mixed; boundary="----- =badboundary" and some garbage before the attachment diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index e9584593..388a1c6c 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -1629,7 +1629,8 @@ reformat_part (CT ct, char *file, char *type, char *subtype, int c_type) { } output_encoding = content_encoding (ct, &reason); - if (set_ct_type (ct, c_type, output_subtype, output_encoding) == OK) { + if (status == OK && + set_ct_type (ct, c_type, output_subtype, output_encoding) == OK) { ct->c_cefile.ce_file = file; ct->c_cefile.ce_unlink = 1; } else { -- 2.56.0