aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-06-19 13:26:40 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-06-19 13:26:40 +0200
commitfc4e4af774d020b9e191ac50faabcba0027dd27a (patch)
tree14be082fcfa46c5ebb3cb20190ddd0a11782ad54
parentcc7ab258141f91e49d66cde589f26e2e94d9e516 (diff)
downloadmblaze-fc4e4af774d020b9e191ac50faabcba0027dd27a.tar.gz
mmime: don't generate empty filenames
-rw-r--r--mmime.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mmime.c b/mmime.c
index e8f58da..0aee314 100644
--- a/mmime.c
+++ b/mmime.c
@@ -120,6 +120,11 @@ gen_attachment(const char *filename, char *content_disposition)
const char *s = filename;
int quote = 0;
+ if (!*filename) {
+ printf("Content-Disposition: %s\n", content_disposition);
+ return;
+ }
+
for (s = (char *) filename; *s; s++) {
if (*s < 32 || *s == '"' || *s >= 127 || s - filename > 35)
goto rfc2231;