projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ensure event names are NULL terminated during validation
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
cmd.c
diff --git
a/src/bin/lttng-sessiond/cmd.c
b/src/bin/lttng-sessiond/cmd.c
index a80668831076a4396d14bdd45d2c155a01e7641c..8f450acdef70287cd6b757d06d254a13ad2afd39 100644
(file)
--- a/
src/bin/lttng-sessiond/cmd.c
+++ b/
src/bin/lttng-sessiond/cmd.c
@@
-1383,6
+1383,7
@@
static int validate_event_name(const char *name)
int ret = 0;
const char *c = name;
const char *event_name_end = c + LTTNG_SYMBOL_NAME_LEN;
int ret = 0;
const char *c = name;
const char *event_name_end = c + LTTNG_SYMBOL_NAME_LEN;
+ bool null_terminated = false;
/*
* Make sure that unescaped wildcards are only used as the last
/*
* Make sure that unescaped wildcards are only used as the last
@@
-1391,6
+1392,7
@@
static int validate_event_name(const char *name)
while (c < event_name_end) {
switch (*c) {
case '\0':
while (c < event_name_end) {
switch (*c) {
case '\0':
+ null_terminated = true;
goto end;
case '\\':
c++;
goto end;
case '\\':
c++;
@@
-1407,6
+1409,9
@@
static int validate_event_name(const char *name)
c++;
}
end:
c++;
}
end:
+ if (!ret && !null_terminated) {
+ ret = LTTNG_ERR_INVALID_EVENT_NAME;
+ }
return ret;
}
return ret;
}
This page took
0.024645 seconds
and
4
git commands to generate.