summaryrefslogtreecommitdiffstats
path: root/handler.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2022-04-05 13:14:47 -0700
committerKevin McCarthy <kevin@8t8.us>2022-04-05 13:17:43 -0700
commit4ae494ca621842c97f16da0bba61689ab458556c (patch)
treecc7b1c6cb98d7e471118d68780ec7cec61438698 /handler.c
parente5ed080c00e59701ca62ef9b2a6d2612ebf765a5 (diff)
Fix uudecode cleanup on unexpected eof.
Clean up iconv state and state->prefix handling instead of just returning. This is done for the other encoding handlers.
Diffstat (limited to 'handler.c')
-rw-r--r--handler.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/handler.c b/handler.c
index c97cf0cb..a719051a 100644
--- a/handler.c
+++ b/handler.c
@@ -389,7 +389,7 @@ static void mutt_decode_uuencoded (STATE *s, LOFF_T len, int istext, iconv_t cd)
while (len > 0)
{
if ((fgets(tmps, sizeof(tmps), s->fpin)) == NULL)
- return;
+ goto cleanup;
len -= mutt_strlen(tmps);
if ((!mutt_strncmp (tmps, "begin", 5)) && ISSPACE (tmps[5]))
break;
@@ -397,7 +397,7 @@ static void mutt_decode_uuencoded (STATE *s, LOFF_T len, int istext, iconv_t cd)
while (len > 0)
{
if ((fgets(tmps, sizeof(tmps), s->fpin)) == NULL)
- return;
+ goto cleanup;
len -= mutt_strlen(tmps);
if (!mutt_strncmp (tmps, "end", 3))
break;
@@ -421,6 +421,7 @@ static void mutt_decode_uuencoded (STATE *s, LOFF_T len, int istext, iconv_t cd)
}
}
+cleanup:
mutt_convert_to_state (cd, bufi, &k, s);
mutt_convert_to_state (cd, 0, 0, s);