openbsd-ports/mail/pine/patches/patch-pine_mailview_c

33 lines
1.0 KiB
Plaintext

$OpenBSD: patch-pine_mailview_c,v 1.4 2005/11/23 13:44:25 jakob Exp $
--- pine/mailview.c.orig Tue Sep 20 20:26:20 2005
+++ pine/mailview.c Wed Nov 23 14:26:30 2005
@@ -4392,6 +4392,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))
@@ -4467,6 +4470,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;
@@ -4510,7 +4516,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);