From: David Goulet Date: Fri, 12 Aug 2011 21:00:33 +0000 (-0400) Subject: Fix copy_string dst validation X-Git-Tag: v2.0-pre12~31 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e7d6716d41180148eb6baabb56bb68c03aa72beb;p=lttng-tools.git 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';