From: Jérémie Galarneau Date: Sat, 5 Sep 2015 16:02:10 +0000 (-0400) Subject: Fix: Possible passing of NULL pointer to memcpy() X-Git-Tag: v2.8.0-rc1~396 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b742e3e20470f98be1c1fda6d0c5b3346e19d6e8;p=lttng-tools.git Fix: Possible passing of NULL pointer to memcpy() _cmd_enable_event() will not jump to the error label in case of memory allocation of the filter bytecode copy. This causes the NULL return of zmalloc to be used by memcpy() directly. Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 860622d00..6237d673e 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -1826,6 +1826,7 @@ static int _cmd_enable_event(struct ltt_session *session, filter_copy = zmalloc(filter_size); if (!filter_copy) { ret = LTTNG_ERR_NOMEM; + goto error; } memcpy(filter_copy, filter, filter_size);