From e7d6716d41180148eb6baabb56bb68c03aa72beb Mon Sep 17 00:00:00 2001 From: David Goulet Date: Fri, 12 Aug 2011 17:00:33 -0400 Subject: [PATCH] Fix copy_string dst validation Signed-off-by: David Goulet --- liblttngctl/lttngctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liblttngctl/lttngctl.c b/liblttngctl/lttngctl.c index 14055ed48..827de137e 100644 --- a/liblttngctl/lttngctl.c +++ b/liblttngctl/lttngctl.c @@ -47,7 +47,7 @@ static int connected; */ static void copy_string(char *dst, const char *src, size_t len) { - if (src) { + if (src && dst) { strncpy(dst, src, len); /* Enforce the NULL terminated byte */ dst[len - 1] = '\0'; -- 2.34.1