aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--driver.c5
-rw-r--r--report.c2
-rw-r--r--sink.c4
3 files changed, 6 insertions, 5 deletions
diff --git a/driver.c b/driver.c
index 6176bcb9..74e1b28a 100644
--- a/driver.c
+++ b/driver.c
@@ -542,8 +542,9 @@ static int fetch_messages(int mailserver_socket, struct query *ctl,
lastnum = num + fetchsizelimit - 1;
if (lastnum > count)
lastnum = count;
- for (i = 0; i < fetchsizelimit; i++)
- (*msgsizes)[i] = 0;
+ if (*msgsizes)
+ for (i = 0; i < fetchsizelimit; i++)
+ (*msgsizes)[i] = 0;
stage = STAGE_GETSIZES;
err = (ctl->server.base_protocol->getpartialsizes)(mailserver_socket, num, lastnum, *msgsizes);
diff --git a/report.c b/report.c
index 5d9abb73..1466802a 100644
--- a/report.c
+++ b/report.c
@@ -362,7 +362,7 @@ report_at_line (FILE *errfp, errnum, file_name, line_number, message, va_alist)
static unsigned int old_line_number;
if (old_line_number == line_number &&
- (file_name == old_file_name || !strcmp (old_file_name, file_name)))
+ (file_name == old_file_name || (old_file_name != NULL && 0 == strcmp (old_file_name, file_name))))
/* Simply return and print nothing. */
return;
diff --git a/sink.c b/sink.c
index e8dd8355..164c36d8 100644
--- a/sink.c
+++ b/sink.c
@@ -1189,14 +1189,14 @@ static int open_mda_sink(struct query *ctl, struct msgblk *msg,
** the worst case (end of string) sp[1] == '\0' */
if (sp[1] == 's' || sp[1] == 'T') {
*dp++ = '\'';
- strcpy(dp, names);
+ if (names) strcpy(dp, names);
dp += nameslen;
*dp++ = '\'';
sp++; /* position sp over [sT] */
dp--; /* adjust dp */
} else if (sp[1] == 'F') {
*dp++ = '\'';
- strcpy(dp, from);
+ if (from) strcpy(dp, from);
dp += fromlen;
*dp++ = '\'';
sp++; /* position sp over F */