Fix: Possible passing of NULL pointer to memcpy()
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 5 Sep 2015 16:02:10 +0000 (12:02 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 8 Sep 2015 13:32:54 +0000 (09:32 -0400)
_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 <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/cmd.c

index 2ca22c2e9bb9af0bfc6f310433f410a55d9eacd6..4cc590a9585b480142ca4ea54cc0ecf1e770b585 100644 (file)
@@ -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);
 
This page took 0.028682 seconds and 4 git commands to generate.