From 124518ae5fba9e352a9cf8a8d7c1a8160475d10b Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Tue, 14 May 2019 22:46:44 +0200 Subject: In-depth robustness. Reported by: clang static analyzer (clang-8) --- sink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sink.c') 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 */ -- cgit v1.2.3