diff options
Diffstat (limited to 'pith/mailcmd.c')
-rw-r--r-- | pith/mailcmd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pith/mailcmd.c b/pith/mailcmd.c index 903d43c8..69a491e7 100644 --- a/pith/mailcmd.c +++ b/pith/mailcmd.c @@ -2595,15 +2595,18 @@ search_for_our_regex_addresses(MAILSTREAM *stream, char type, int not, } if(addr1 && address_is_us(addr1, ps_global)){ - if((mc=mail_elt(stream, rawno)) != NULL) + if(rawno > 0L && rawno <= stream->nmsgs + && (mc=mail_elt(stream, rawno)) != NULL) mm_searched(stream, rawno); } else if(addr2 && address_is_us(addr2, ps_global)){ - if((mc=mail_elt(stream, rawno)) != NULL) + if(rawno > 0L && rawno <= stream->nmsgs + && (mc=mail_elt(stream, rawno)) != NULL) mm_searched(stream, rawno); } else if(addr3 && address_is_us(addr3, ps_global)){ - if((mc=mail_elt(stream, rawno)) != NULL) + if(rawno > 0L && rawno <= stream->nmsgs + && (mc=mail_elt(stream, rawno)) != NULL) mm_searched(stream, rawno); } } |