projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: liblttng-ctl: unchecked return value on buffer append
[lttng-tools.git]
/
src
/
lib
/
lttng-ctl
/
lttng-ctl.c
diff --git
a/src/lib/lttng-ctl/lttng-ctl.c
b/src/lib/lttng-ctl/lttng-ctl.c
index 4eb36a2612d952bb71d38e9cedcc4d70a47d6148..3f1ab9fdc4bb8f17abe91345355b11f3263d61e2 100644
(file)
--- a/
src/lib/lttng-ctl/lttng-ctl.c
+++ b/
src/lib/lttng-ctl/lttng-ctl.c
@@
-2970,7
+2970,11
@@
int lttng_register_trigger(struct lttng_trigger *trigger)
goto end;
}
goto end;
}
- lttng_dynamic_buffer_append(&message.buffer, &lsm, sizeof(lsm));
+ ret = lttng_dynamic_buffer_append(&message.buffer, &lsm, sizeof(lsm));
+ if (ret) {
+ ret = -LTTNG_ERR_NOMEM;
+ goto end;
+ }
/*
* This is needed to populate the trigger object size for the command
/*
* This is needed to populate the trigger object size for the command
@@
-3030,7
+3034,11
@@
int lttng_unregister_trigger(struct lttng_trigger *trigger)
memset(&lsm, 0, sizeof(lsm));
lsm.cmd_type = LTTNG_UNREGISTER_TRIGGER;
memset(&lsm, 0, sizeof(lsm));
lsm.cmd_type = LTTNG_UNREGISTER_TRIGGER;
- lttng_dynamic_buffer_append(&message.buffer, &lsm, sizeof(lsm));
+ ret = lttng_dynamic_buffer_append(&message.buffer, &lsm, sizeof(lsm));
+ if (ret) {
+ ret = -LTTNG_ERR_NOMEM;
+ goto end;
+ }
/*
* This is needed to populate the trigger object size for the command
/*
* This is needed to populate the trigger object size for the command
This page took
0.023881 seconds
and
4
git commands to generate.