From: Mathieu Desnoyers Date: Wed, 26 Sep 2012 02:50:39 +0000 (-0400) Subject: Fix: BSD getprogname null pointer dereference X-Git-Tag: v2.1.0-rc2~38 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7c41892ff829c521b304bd086b9796f69302e091;p=lttng-ust.git Fix: BSD getprogname null pointer dereference Signed-off-by: Christian Babeux Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust/compat.h b/liblttng-ust/compat.h index 58d8585c..4d4a4368 100644 --- a/liblttng-ust/compat.h +++ b/liblttng-ust/compat.h @@ -55,7 +55,8 @@ void lttng_ust_getprocname(char *name) bsd_name = getprogname(); if (!bsd_name) name[0] = '\0'; - memcpy(name, bsd_name, LTTNG_UST_PROCNAME_LEN - 1); + else + memcpy(name, bsd_name, LTTNG_UST_PROCNAME_LEN - 1); } #endif