From b742e3e20470f98be1c1fda6d0c5b3346e19d6e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Sat, 5 Sep 2015 12:02:10 -0400 Subject: [PATCH] Fix: Possible passing of NULL pointer to memcpy() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit _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 --- src/bin/lttng-sessiond/cmd.c | 1 + 1 file changed, 1 insertion(+) 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); -- 2.34.1