From 013660c93eebf5bd0a1501b7d3e741ad87a3ad25 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Fri, 4 Apr 2008 20:03:44 +0000 Subject: [PATCH] Check for valid attachment array SVN revision: 2093 --- src/elogd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index 4d9885e9..2280c409 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -16442,7 +16442,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp rsputs(" "); for (i = 0; i < MAX_ATTACHMENTS; i++) - if (attachment[i][0]) { + if (attachment && attachment[i][0]) { strlcpy(str, attachment[i], sizeof(str)); str[13] = 0; sprintf(ref, "../%s/%s/%s", lbs->name, str, attachment[i] + 14); @@ -16762,7 +16762,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp rsputs(" "); for (i = 0; i < MAX_ATTACHMENTS; i++) - if (attachment[i][0]) { + if (attachment && attachment[i][0]) { strlcpy(str, attachment[i], sizeof(str)); str[13] = 0; sprintf(ref, "../%s/%s/%s", lbs->name, str, attachment[i] + 14); @@ -16868,7 +16868,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp rsputs(" "); for (i = 0; i < MAX_ATTACHMENTS; i++) - if (attachment[i][0]) { + if (attachment && attachment[i][0]) { strlcpy(str, attachment[i], sizeof(str)); str[13] = 0; sprintf(ref, "../%s/%s/%s", lbs->name, str, attachment[i] + 14);