projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: lttng: add-trigger: invalid access past end of exclusions buffer
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
main.c
diff --git
a/src/bin/lttng-sessiond/main.c
b/src/bin/lttng-sessiond/main.c
index 05566d5f86fdb6494e8069bdafc7c03cbc05733a..1174162aa9ac8df25b4dcfc23994a95ac09e50bb 100644
(file)
--- a/
src/bin/lttng-sessiond/main.c
+++ b/
src/bin/lttng-sessiond/main.c
@@
-856,7
+856,7
@@
static int set_options(int argc, char **argv)
int ret = 0, c = 0, option_index = 0;
int orig_optopt = optopt, orig_optind = optind;
char *optstring;
int ret = 0, c = 0, option_index = 0;
int orig_optopt = optopt, orig_optind = optind;
char *optstring;
- c
onst c
har *config_path = NULL;
+ char *config_path = NULL;
optstring = utils_generate_optstring(long_options,
sizeof(long_options) / sizeof(struct option));
optstring = utils_generate_optstring(long_options,
sizeof(long_options) / sizeof(struct option));
@@
-880,6
+880,7
@@
static int set_options(int argc, char **argv)
WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
"-f, --config");
} else {
WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
"-f, --config");
} else {
+ free(config_path);
config_path = utils_expand_path(optarg);
if (!config_path) {
ERR("Failed to resolve path: %s", optarg);
config_path = utils_expand_path(optarg);
if (!config_path) {
ERR("Failed to resolve path: %s", optarg);
@@
-925,6
+926,7
@@
static int set_options(int argc, char **argv)
}
end:
}
end:
+ free(config_path);
free(optstring);
return ret;
}
free(optstring);
return ret;
}
@@
-1331,7
+1333,7
@@
static void unregister_all_triggers(void)
struct lttng_triggers *triggers = NULL;
unsigned int trigger_count, i;
const struct lttng_credentials creds = {
struct lttng_triggers *triggers = NULL;
unsigned int trigger_count, i;
const struct lttng_credentials creds = {
-
.uid = LTTNG_OPTIONAL_INIT_VALUE(0),
+ .uid = LTTNG_OPTIONAL_INIT_VALUE(0),
};
DBG("Unregistering all triggers");
};
DBG("Unregistering all triggers");
@@
-1363,7
+1365,8
@@
static void unregister_all_triggers(void)
assert(trigger_status == LTTNG_TRIGGER_STATUS_OK);
trigger_status = lttng_trigger_get_name(trigger, &trigger_name);
assert(trigger_status == LTTNG_TRIGGER_STATUS_OK);
trigger_status = lttng_trigger_get_name(trigger, &trigger_name);
- assert(trigger_status == LTTNG_TRIGGER_STATUS_OK);
+ trigger_name = trigger_status == LTTNG_TRIGGER_STATUS_OK ?
+ trigger_name : "(anonymous)";
DBG("Unregistering trigger: trigger owner uid = %d, trigger name = '%s'",
(int) trigger_owner, trigger_name);
DBG("Unregistering trigger: trigger owner uid = %d, trigger name = '%s'",
(int) trigger_owner, trigger_name);
This page took
0.027292 seconds
and
4
git commands to generate.