$OpenBSD: patch-pine_mailview_c,v 1.3 2005/04/29 19:51:35 jakob Exp $ --- pine/mailview.c.orig Wed Apr 27 20:55:02 2005 +++ pine/mailview.c Fri Apr 29 19:49:47 2005 @@ -4391,6 +4391,9 @@ url_hilite(linenum, line, ins, local) char buf[256], color[256]; HANDLE_S *h; + if (line == NULL) + return (-1); + for(lp = line; ; lp = up + n){ /* scan for all of them so we can choose the first */ if(F_ON(F_VIEW_SEL_URL,ps_global)) @@ -4466,6 +4469,9 @@ url_hilite_hdr(linenum, line, ins, local static int check_for_urls = 0; register char *lp; + if (line == NULL) + return (-1); + if(isspace((unsigned char)*line)) /* continuation, check or not depending on last line */ lp = line; @@ -4509,7 +4515,7 @@ url_hilite_abook(linenum, line, ins, loc { register char *lp; - if((lp = strchr(line, ':')) && + if(line && (lp = strchr(line, ':')) && !strncmp(line, AB_COMMENT_STR, strlen(AB_COMMENT_STR))) (void) url_hilite(linenum, lp + 1, ins, local);