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.7.0-rc2~72 X-Git-Url: http://git.lttng.org/?a=commitdiff_plain;h=4c579b1f0f356e241627265c107757f2568c8daa;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 2ca22c2e9..4cc590a95 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -1812,6 +1812,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);