projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: out-of-bound memory access
[babeltrace.git]
/
formats
/
ctf
/
ctf.c
diff --git
a/formats/ctf/ctf.c
b/formats/ctf/ctf.c
index 9cb19f4dc323159be1da0bb8e4b00b3526577ffd..fb9b2333cf63180a208ace408b9d9b1b90deebc4 100644
(file)
--- a/
formats/ctf/ctf.c
+++ b/
formats/ctf/ctf.c
@@
-936,6
+936,11
@@
void ctf_packet_seek(struct bt_stream_pos *stream_pos, size_t index, int whence)
assert(0);
}
assert(0);
}
+ if (pos->cur_index >= pos->packet_index->len) {
+ pos->offset = EOF;
+ return;
+ }
+
packet_index = &g_array_index(pos->packet_index,
struct packet_index, pos->cur_index);
if (pos->cur_index > 0) {
packet_index = &g_array_index(pos->packet_index,
struct packet_index, pos->cur_index);
if (pos->cur_index > 0) {
@@
-948,11
+953,6
@@
void ctf_packet_seek(struct bt_stream_pos *stream_pos, size_t index, int whence)
ctf_update_current_packet_index(&file_stream->parent,
prev_index, packet_index);
ctf_update_current_packet_index(&file_stream->parent,
prev_index, packet_index);
- if (pos->cur_index >= pos->packet_index->len) {
- pos->offset = EOF;
- return;
- }
-
/*
* We need to check if we are in trace read or called
* from packet indexing. In this last case, the
/*
* We need to check if we are in trace read or called
* from packet indexing. In this last case, the
This page took
0.023661 seconds
and
4
git commands to generate.