From: David Goulet Date: Fri, 12 Aug 2011 21:00:33 +0000 (-0400) Subject: Fix copy_string dst validation X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=e7d6716d41180148eb6baabb56bb68c03aa72beb Fix copy_string dst validation Signed-off-by: David Goulet --- 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';