projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ctf: assert that request_sz in medium ops request_bytes is greater than 0
[babeltrace.git]
/
src
/
plugins
/
ctf
/
fs-src
/
data-stream-file.c
diff --git
a/src/plugins/ctf/fs-src/data-stream-file.c
b/src/plugins/ctf/fs-src/data-stream-file.c
index 30da41a140fca4ee278dc5cfdd63f7d6f1c8b675..c4edcd32553104718c39d8c72fa05e8430450a8e 100644
(file)
--- a/
src/plugins/ctf/fs-src/data-stream-file.c
+++ b/
src/plugins/ctf/fs-src/data-stream-file.c
@@
-143,9
+143,7
@@
enum ctf_msg_iter_medium_status medop_request_bytes(
bt_self_component *self_comp = ds_file->self_comp;
bt_logging_level log_level = ds_file->log_level;
bt_self_component *self_comp = ds_file->self_comp;
bt_logging_level log_level = ds_file->log_level;
- if (request_sz == 0) {
- goto end;
- }
+ BT_ASSERT(request_sz > 0);
/*
* Check if we have at least one memory-mapped byte left. If we don't,
/*
* Check if we have at least one memory-mapped byte left. If we don't,
@@
-174,9
+172,12
@@
enum ctf_msg_iter_medium_status medop_request_bytes(
}
}
}
}
+ BT_ASSERT(remaining_mmap_bytes(ds_file) > 0);
*buffer_sz = MIN(remaining_mmap_bytes(ds_file), request_sz);
*buffer_sz = MIN(remaining_mmap_bytes(ds_file), request_sz);
+
BT_ASSERT(ds_file->mmap_addr);
*buffer_addr = ((uint8_t *) ds_file->mmap_addr) + ds_file->request_offset_in_mapping;
BT_ASSERT(ds_file->mmap_addr);
*buffer_addr = ((uint8_t *) ds_file->mmap_addr) + ds_file->request_offset_in_mapping;
+
ds_file->request_offset_in_mapping += *buffer_sz;
goto end;
ds_file->request_offset_in_mapping += *buffer_sz;
goto end;
This page took
0.024373 seconds
and
4
git commands to generate.