From: David Goulet Date: Wed, 12 Mar 2014 17:48:53 +0000 (-0400) Subject: Fix: possible load config domain overwrite X-Git-Tag: v2.5.0-rc1~116 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c33e6729ebef69f69a239dd7aee61e802ea29ab6;p=lttng-tools.git Fix: possible load config domain overwrite The uniqueness of the domain CAN NOT be enforced with the XML xsd schema so if the same domains are seen, return an error. Fixes coverity issue 1191755. Signed-off-by: David Goulet --- diff --git a/src/common/config/config.c b/src/common/config/config.c index 5e100a7ab..4eaa274e8 100644 --- a/src/common/config/config.c +++ b/src/common/config/config.c @@ -2198,12 +2198,24 @@ int process_session_node(xmlNodePtr session_node, const char *session_name, switch (domain->type) { case LTTNG_DOMAIN_KERNEL: + if (kernel_domain) { + /* Same domain seen twice, invalid! */ + goto domain_init_error; + } kernel_domain = domain; break; case LTTNG_DOMAIN_UST: + if (ust_domain) { + /* Same domain seen twice, invalid! */ + goto domain_init_error; + } ust_domain = domain; break; case LTTNG_DOMAIN_JUL: + if (jul_domain) { + /* Same domain seen twice, invalid! */ + goto domain_init_error; + } jul_domain = domain; break; default: