projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix: add missing overflow check in bt_ctf_stream_pos_access_ok
[babeltrace.git]
/
include
/
babeltrace
/
ctf-writer
/
serialize-internal.h
diff --git
a/include/babeltrace/ctf-writer/serialize-internal.h
b/include/babeltrace/ctf-writer/serialize-internal.h
index b0ef6cb9ffa13689aded75c679ac651840b801cf..781a3dd7f1938425892cf2fb7325170b165e9f9b 100644
(file)
--- a/
include/babeltrace/ctf-writer/serialize-internal.h
+++ b/
include/babeltrace/ctf-writer/serialize-internal.h
@@
-84,6
+84,9
@@
int bt_ctf_stream_pos_access_ok(struct bt_ctf_stream_pos *pos, uint64_t bit_len)
/* Writes may take place up to the end of the packet. */
max_len = pos->packet_size;
}
+ if (unlikely(pos->offset < 0 || bit_len > INT64_MAX - pos->offset)) {
+ return 0;
+ }
if (unlikely(pos->offset + bit_len > max_len))
return 0;
return 1;
This page took
0.02427 seconds
and
4
git commands to generate.