Fix: sessiond: user/group name can be leaked on malformed command
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 27 Mar 2020 15:01:05 +0000 (11:01 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 27 Mar 2020 15:03:27 +0000 (11:03 -0400)
process_attr_value_from_comm() can leak a copy of the user/group
name when the value type is erroneous. This is not reachable in
"normal" execution, but could be triggered by invalid "crafter"
lttng-ctl commands.

In process_attr_value_from_comm: Leak of memory or pointers to
system resources (CWE-404).

Reported-by: Coverity Scan
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I7ef55c0743c954a93e3d27ce17e6478708b49437

src/common/tracker.c

index 532a924b56a772b3d55d11e611028ebf7267a7fe..c27d9765562e590241e2ae9ba5ece15e8bbdc1a0 100644 (file)
@@ -173,6 +173,7 @@ enum lttng_error_code process_attr_value_from_comm(
 
        *_value = value;
        value = NULL;
+       free(name);
        return LTTNG_OK;
 error:
        free(name);
This page took 0.034693 seconds and 4 git commands to generate.