projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: define _LGPL_SOURCE in C files
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
syscall.c
diff --git
a/src/bin/lttng-sessiond/syscall.c
b/src/bin/lttng-sessiond/syscall.c
index ee7578051e2a12d3322cb6e3d9fd4ae2946da1a7..eb81d67429a2d96ac6b062db40940988ad0dd58c 100644
(file)
--- a/
src/bin/lttng-sessiond/syscall.c
+++ b/
src/bin/lttng-sessiond/syscall.c
@@
-16,6
+16,7
@@
*/
#define _GNU_SOURCE
*/
#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <common/bitfield.h>
#include <common/common.h>
#include <common/kernel-ctl/kernel-ctl.h>
#include <common/bitfield.h>
#include <common/common.h>
#include <common/kernel-ctl/kernel-ctl.h>
@@
-35,7
+36,7
@@
static size_t syscall_table_nb_entry;
* Populate the system call table using the kernel tracer.
*
* Return 0 on success and the syscall table is allocated. On error, a negative
* Populate the system call table using the kernel tracer.
*
* Return 0 on success and the syscall table is allocated. On error, a negative
- * value is returned
and the syscall table is set to NULL
.
+ * value is returned.
*/
int syscall_init_table(void)
{
*/
int syscall_init_table(void)
{
@@
-82,6
+83,14
@@
int syscall_init_table(void)
/* Double memory size. */
new_nbmem = max(index, nbmem << 1);
/* Double memory size. */
new_nbmem = max(index, nbmem << 1);
+ if (new_nbmem < nbmem) {
+ /* Overflow, stop everything, something went really wrong. */
+ ERR("Syscall listing memory size overflow. Stopping");
+ free(syscall_table);
+ syscall_table = NULL;
+ ret = -EINVAL;
+ goto error;
+ }
DBG("Reallocating syscall table from %zu to %zu entries", nbmem,
new_nbmem);
DBG("Reallocating syscall table from %zu to %zu entries", nbmem,
new_nbmem);
This page took
0.025758 seconds
and
5
git commands to generate.