aboutsummaryrefslogtreecommitdiff
path: root/blaze822.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2019-02-27 22:43:15 +0100
committerLeah Neukirchen <leah@vuxu.org>2019-02-27 22:43:15 +0100
commit5fc3115c3f41df18a9bc539a0d57cb830d1a7161 (patch)
treebe05bed63cd29feaa4d36c8df31cbd4b0e2861ad /blaze822.c
parent3d3fffd7e89937229e64d458d8ac65db1f22fbfe (diff)
downloadmblaze-5fc3115c3f41df18a9bc539a0d57cb830d1a7161.tar.gz
blaze822: blaze822_addr: don't drop last char when comment is not closed
Found by duncaen with afl.
Diffstat (limited to 'blaze822.c')
-rw-r--r--blaze822.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/blaze822.c b/blaze822.c
index d8edcad..cbaef57 100644
--- a/blaze822.c
+++ b/blaze822.c
@@ -281,7 +281,8 @@ blaze822_addr(char *s, char **dispo, char **addro)
} else if (*s == '(') {
char *z = skip_comment(s);
if (!*disp && *addr) // user@host (name)
- safe_append(disp, sizeof disp, s + 1, z - 1);
+ safe_append(disp, sizeof disp, s + 1,
+ *z ? z - 1 : z);
else if (*disp) { // copy comment
safe_append_space(disp, sizeof disp);
safe_append(disp, sizeof disp, s, z);