diff options
| author | Sam Varshavchik | 2018-06-25 17:34:33 -0400 | 
|---|---|---|
| committer | Sam Varshavchik | 2018-06-25 17:34:33 -0400 | 
| commit | 4c78ff960c041b02f47f029aa39eed0c2750ac05 (patch) | |
| tree | c388e102c35a6cefecd768f977f9741528cef1b6 /rfc2045/reformime.c | |
| parent | 778d07bc34d03e4ad77e7438898a54f3dbb2e31a (diff) | |
| download | courier-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.c | 5 | 
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) | 
