Skip to content
Snippets Groups Projects
Commit 633f5e8d authored by Brian Carrier's avatar Brian Carrier
Browse files

resolved merge conflict

parents 228c66a0 cef807d0
No related branches found
No related tags found
No related merge requests found
......@@ -211,13 +211,18 @@ tsk_img_read(TSK_IMG_INFO * a_img_info, TSK_OFF_T a_off,
// Determine the offset relative to the start of the cached data.
rel_off = a_off - a_img_info->cache_off[cache_next];
// Make sure we were able to read sufficient data into the cache.
if (rel_off > (TSK_OFF_T) read_count) {
len2 = 0;
}
// Make sure not to copy more than is available in the cache.
if ((rel_off + (TSK_OFF_T) len2) > (TSK_OFF_T) read_count) {
else if ((rel_off + (TSK_OFF_T) len2) > (TSK_OFF_T) read_count) {
len2 = (size_t) (read_count - rel_off);
}
memcpy(a_buf, &(a_img_info->cache[cache_next][rel_off]), len2);
// Only copy data when we have something to copy.
if (len2 > 0) {
memcpy(a_buf, &(a_img_info->cache[cache_next][rel_off]), len2);
}
read_count = (ssize_t) len2;
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment