summaryrefslogtreecommitdiffstats
path: root/rfc2045/reformime.c
diff options
context:
space:
mode:
authorSam Varshavchik2018-06-25 17:34:33 -0400
committerSam Varshavchik2018-06-25 17:34:33 -0400
commit4c78ff960c041b02f47f029aa39eed0c2750ac05 (patch)
treec388e102c35a6cefecd768f977f9741528cef1b6 /rfc2045/reformime.c
parent778d07bc34d03e4ad77e7438898a54f3dbb2e31a (diff)
downloadcourier-libs-4c78ff960c041b02f47f029aa39eed0c2750ac05.tar.bz2
reformime: fix crash when -x/-X is specified without a -s.
Diffstat (limited to 'rfc2045/reformime.c')
-rw-r--r--rfc2045/reformime.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rfc2045/reformime.c b/rfc2045/reformime.c
index 4d1fb67..a47eabf 100644
--- a/rfc2045/reformime.c
+++ b/rfc2045/reformime.c
@@ -1179,11 +1179,12 @@ int rc=0;
dsn(p, dodsn == 2);
else if (do_extract)
{
- mimesection = strtok(section,",");
+ mimesection = section ? strtok(section, ","):NULL;
do {
extract_section(p, mimesection, extract_filename,
argc-argn, argv+argn, do_extract);
- mimesection = strtok(NULL,",");
+ if (mimesection)
+ mimesection = strtok(NULL,",");
} while (mimesection != NULL);
}
else if (dovalidate)