From 079edc35a1beffc38d082045b2f963b26a141178 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 27 Sep 2016 01:42:55 +0200 Subject: [PATCH] Do RFC 2047 decoding on filename for mhstore --- uip/mhstoresbr.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index 62a5ba43..f1756a86 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -1055,6 +1055,7 @@ get_storeproc (CT ct) { char *cp; CI ci; + char storefile[PATH_MAX+1]; /* * If the storeproc has already been defined, @@ -1070,12 +1071,13 @@ get_storeproc (CT ct) */ if (ct->c_dispo) { if ((cp = get_param(ct->c_dispo_first, "filename", '_', 0)) - && *cp != '/' - && *cp != '.' - && *cp != '|' - && *cp != '!' - && !strchr (cp, '%')) { - ct->c_storeproc = add (cp, NULL); + && decode_rfc2047(cp, storefile, PATH_MAX+1) + && *storefile != '/' + && *storefile != '.' + && *storefile != '|' + && *storefile != '!' + && !strchr (storefile, '%')) { + ct->c_storeproc = add (storefile, NULL); free(cp); return; } @@ -1090,12 +1092,13 @@ get_storeproc (CT ct) */ ci = &ct->c_ctinfo; if ((cp = get_param(ci->ci_first_pm, "name", '_', 0)) - && *cp != '/' - && *cp != '.' - && *cp != '|' - && *cp != '!' - && !strchr (cp, '%')) { - ct->c_storeproc = add (cp, NULL); + && decode_rfc2047(cp, storefile, PATH_MAX+1) + && *storefile != '/' + && *storefile != '.' + && *storefile != '|' + && *storefile != '!' + && !strchr (storefile, '%')) { + ct->c_storeproc = add (storefile, NULL); } if (cp) -- 2.56.0