address this problem observed with sources' upas/fs and nasty apple client: acid: stk() cistrstr(sub=0x2e359,s=0x0)+0x3c /sys/src/libc/port/cistrstr.c:16 searchMsg(m=0x37ee0,s=0x2e308)+0x515 /sys/src/cmd/ip/imap4d/search.c:105 searchUCmd(uids=0x1,tg=0x2e258,cmd=0x2e298)+0x99 /sys/src/cmd/ip/imap4d/imap4d.c:1086 uidCmd(tg=0x2e258,cmd=0x2e278)+0xb8 /sys/src/cmd/ip/imap4d/imap4d.c:1326 imap4(preauth=0x0)+0x15f /sys/src/cmd/ip/imap4d/imap4d.c:332 main(argv=0xdfffef8c,argc=0x0)+0x19c /sys/src/cmd/ip/imap4d/imap4d.c:281 _main+0x31 /sys/src/libc/386/main9.s:16 acid: lstk() - erik Reference: /n/sources/patch/applied/imap4dsrch Date: Thu Jun 19 00:16:39 CES 2008 Signed-off-by: quanstro@quanstro.net --- /sys/src/cmd/ip/imap4d/search.c Thu Jun 19 00:16:00 2008 +++ /sys/src/cmd/ip/imap4d/search.c Thu Jun 19 00:15:58 2008 @@ -102,7 +102,9 @@ ok = addrSearch(m->to, s->s); break; case SKSubject: - ok = cistrstr(m->info[ISubject], s->s) != nil; + ok = 0; + if(m->info[ISubject]) + ok = cistrstr(m->info[ISubject], s->s) != nil; break; case SKBefore: