changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: Check if 'm' is null when updating messages.

changeset 7421: fe8aefb6ab34
parent 7420: c6a1b19ee479
child 7422: 714b929020e9
author: Ori Bernstein <ori@eigenstate.org>
date: Mon, 28 Oct 2019 14:12:44 -0700
files: sys/src/cmd/upas/fs/imap.c
description: Check if 'm' is null when updating messages.
     1.1--- a/sys/src/cmd/upas/fs/imap.c
     1.2+++ b/sys/src/cmd/upas/fs/imap.c
     1.3@@ -355,9 +355,10 @@ redux:
     1.4 				m->imapuid = v;
     1.5 			if(imap->nuid < imap->muid)
     1.6 				imap->f[imap->nuid].uid = v;
     1.7-		}else if(strcmp(f[i], "flags") == 0)
     1.8-			parseflags(m, f[i + 1]);
     1.9-		else if(strncmp(f[i], "body[]", 6) == 0){
    1.10+		}else if(strcmp(f[i], "flags") == 0){
    1.11+			if(m)
    1.12+				parseflags(m, f[i + 1]);
    1.13+		}else if(strncmp(f[i], "body[]", 6) == 0){
    1.14 			s = f[i]+6;
    1.15 			o = 0;
    1.16 			if(*s == '<')
    1.17@@ -562,7 +563,7 @@ imap4modflags(Mailbox *mb, Message *m, i
    1.18 	if(p > buf){
    1.19 		p[-1] = 0;
    1.20 		imap4cmd(imap, "uid store %lud flags (%s)", (ulong)m->imapuid, buf);
    1.21-		imap4resp(imap);
    1.22+		imap4resp0(imap, mb, m);
    1.23 	}
    1.24 }
    1.25