summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Varshavchik2018-08-09 06:46:12 -0400
committerSam Varshavchik2018-08-09 06:46:12 -0400
commitbb5416445b1e6c1cbfeb32ac1a233e041af699ce (patch)
treeb24b354306f0f07e2df90bd85b98c8a4c6b41699
parentb843eef0a9233aa7d028a3328b00b18595f3b2e2 (diff)
downloadcourier-libs-bb5416445b1e6c1cbfeb32ac1a233e041af699ce.tar.bz2
reformime: fix crash when -e is specified without a -s.
-rw-r--r--rfc2045/reformime.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rfc2045/reformime.c b/rfc2045/reformime.c
index 8bdfa6c..302fdc6 100644
--- a/rfc2045/reformime.c
+++ b/rfc2045/reformime.c
@@ -1197,10 +1197,11 @@ int rc=0;
}
else if (dodecode)
{
- mimesection = strtok(section,",");
+ mimesection = section ? strtok(section,","):NULL;
do {
print_decode(p, mimesection);
- mimesection = strtok(NULL,",");
+ if (mimesection)
+ mimesection = strtok(NULL,",");
} while (mimesection != NULL);
}
else if (dorewrite)