X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=liblttngctl%2Flttngctl.c;h=827de137e550ef33de57de09f0d823079d2fd513;hp=14055ed48451b652b06db40e72e7b1de013e3bff;hb=e7d6716d41180148eb6baabb56bb68c03aa72beb;hpb=8ca96153694cb63db167defaf46cf9c378426878 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';