projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: memcpy of string is larger than source
[lttng-ust.git]
/
liblttng-ust
/
lttng-ust-comm.c
diff --git
a/liblttng-ust/lttng-ust-comm.c
b/liblttng-ust/lttng-ust-comm.c
index 842876fb743c857cf519ff5161d8d333d639bd16..efc6724f1b6510538e3a2d7063c1dc8093e02c6c 100644
(file)
--- a/
liblttng-ust/lttng-ust-comm.c
+++ b/
liblttng-ust/lttng-ust-comm.c
@@
-293,6
+293,14
@@
int handle_message(struct sock_info *sock_info,
ret = -EINVAL;
goto error;
}
ret = -EINVAL;
goto error;
}
+
+ if (lum->u.filter.reloc_offset > lum->u.filter.data_size) {
+ ERR("Filter reloc offset %u is not within data\n",
+ lum->u.filter.reloc_offset);
+ ret = -EINVAL;
+ goto error;
+ }
+
bytecode = zmalloc(sizeof(*bytecode) + lum->u.filter.data_size);
if (!bytecode) {
ret = -ENOMEM;
bytecode = zmalloc(sizeof(*bytecode) + lum->u.filter.data_size);
if (!bytecode) {
ret = -ENOMEM;
@@
-608,9
+616,9
@@
int get_wait_shm(struct sock_info *sock_info, size_t mmap_size)
ret = ftruncate(wait_shm_fd, mmap_size);
if (ret) {
PERROR("ftruncate");
ret = ftruncate(wait_shm_fd, mmap_size);
if (ret) {
PERROR("ftruncate");
- exit(EXIT_FAILURE);
+
_
exit(EXIT_FAILURE);
}
}
- exit(EXIT_SUCCESS);
+
_
exit(EXIT_SUCCESS);
}
/*
* For local shm, we need to have rw access to accept
}
/*
* For local shm, we need to have rw access to accept
@@
-622,13
+630,13
@@
int get_wait_shm(struct sock_info *sock_info, size_t mmap_size)
*/
if (!sock_info->global && errno != EACCES) {
ERR("Error opening shm %s", sock_info->wait_shm_path);
*/
if (!sock_info->global && errno != EACCES) {
ERR("Error opening shm %s", sock_info->wait_shm_path);
- exit(EXIT_FAILURE);
+
_
exit(EXIT_FAILURE);
}
/*
* The shm exists, but we cannot open it RW. Report
* success.
*/
}
/*
* The shm exists, but we cannot open it RW. Report
* success.
*/
- exit(EXIT_SUCCESS);
+
_
exit(EXIT_SUCCESS);
} else {
return -1;
}
} else {
return -1;
}
This page took
0.025515 seconds
and
4
git commands to generate.