From ece271777131069bdb3749692c793d7ca7b0f639 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Fri, 8 Jun 2018 14:02:50 +0200 Subject: mdeliver: more careful Status: parsing --- mdeliver.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'mdeliver.c') diff --git a/mdeliver.c b/mdeliver.c index ea68647..cbd049a 100644 --- a/mdeliver.c +++ b/mdeliver.c @@ -115,15 +115,16 @@ tryagain: break; if (Mflag && in_header && - (strncasecmp("status:", line, 6) == 0 || - strncasecmp("x-status:", line, 8) == 0)) { + (strncasecmp("status:", line, 7) == 0 || + strncasecmp("x-status:", line, 9) == 0)) { char *v = strchr(line, ':'); - if (strchr(v, 'F')) statusflags[0] = 'F'; - if (strchr(v, 'A')) statusflags[1] = 'R'; - if (strchr(v, 'R')) statusflags[2] = 'S'; - if (strchr(v, 'D')) statusflags[3] = 'T'; - if (strchr(v, 'O')) is_old = 1; - + if (v) { + if (strchr(v, 'F')) statusflags[0] = 'F'; + if (strchr(v, 'A')) statusflags[1] = 'R'; + if (strchr(v, 'R')) statusflags[2] = 'S'; + if (strchr(v, 'D')) statusflags[3] = 'T'; + if (strchr(v, 'O')) is_old = 1; + } continue; // drop header } -- cgit 1.4.1