projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: add stricter checks on packet boundaries
[babeltrace.git]
/
formats
/
ctf
/
types
/
integer.c
diff --git
a/formats/ctf/types/integer.c
b/formats/ctf/types/integer.c
index 257341adfa41ce6320a68a00e04cf6bc4d43490f..189943e6052438bc4b6e3cb2895dcbfc54005562 100644
(file)
--- a/
formats/ctf/types/integer.c
+++ b/
formats/ctf/types/integer.c
@@
-49,7
+49,8
@@
int _aligned_integer_read(struct bt_stream_pos *ppos,
struct ctf_stream_pos *pos = ctf_pos(ppos);
int rbo = (integer_declaration->byte_order != BYTE_ORDER); /* reverse byte order */
struct ctf_stream_pos *pos = ctf_pos(ppos);
int rbo = (integer_declaration->byte_order != BYTE_ORDER); /* reverse byte order */
- ctf_align_pos(pos, integer_declaration->p.alignment);
+ if (!ctf_align_pos(pos, integer_declaration->p.alignment))
+ return -EFAULT;
if (!ctf_pos_access_ok(pos, integer_declaration->len))
return -EFAULT;
if (!ctf_pos_access_ok(pos, integer_declaration->len))
return -EFAULT;
@@
-136,7
+137,8
@@
int _aligned_integer_read(struct bt_stream_pos *ppos,
assert(0);
}
}
assert(0);
}
}
- ctf_move_pos(pos, integer_declaration->len);
+ if (!ctf_move_pos(pos, integer_declaration->len))
+ return -EFAULT;
return 0;
}
return 0;
}
@@
-151,7
+153,8
@@
int _aligned_integer_write(struct bt_stream_pos *ppos,
struct ctf_stream_pos *pos = ctf_pos(ppos);
int rbo = (integer_declaration->byte_order != BYTE_ORDER); /* reverse byte order */
struct ctf_stream_pos *pos = ctf_pos(ppos);
int rbo = (integer_declaration->byte_order != BYTE_ORDER); /* reverse byte order */
- ctf_align_pos(pos, integer_declaration->p.alignment);
+ if (!ctf_align_pos(pos, integer_declaration->p.alignment))
+ return -EFAULT;
if (!ctf_pos_access_ok(pos, integer_declaration->len))
return -EFAULT;
if (!ctf_pos_access_ok(pos, integer_declaration->len))
return -EFAULT;
@@
-207,7
+210,8
@@
int _aligned_integer_write(struct bt_stream_pos *ppos,
}
}
end:
}
}
end:
- ctf_move_pos(pos, integer_declaration->len);
+ if (!ctf_move_pos(pos, integer_declaration->len))
+ return -EFAULT;
return 0;
}
return 0;
}
@@
-224,7
+228,8
@@
int ctf_integer_read(struct bt_stream_pos *ppos, struct bt_definition *definitio
return _aligned_integer_read(ppos, definition);
}
return _aligned_integer_read(ppos, definition);
}
- ctf_align_pos(pos, integer_declaration->p.alignment);
+ if (!ctf_align_pos(pos, integer_declaration->p.alignment))
+ return -EFAULT;
if (!ctf_pos_access_ok(pos, integer_declaration->len))
return -EFAULT;
if (!ctf_pos_access_ok(pos, integer_declaration->len))
return -EFAULT;
@@
-252,7
+257,8
@@
int ctf_integer_read(struct bt_stream_pos *ppos, struct bt_definition *definitio
pos->offset, integer_declaration->len,
&integer_definition->value._signed);
}
pos->offset, integer_declaration->len,
&integer_definition->value._signed);
}
- ctf_move_pos(pos, integer_declaration->len);
+ if (!ctf_move_pos(pos, integer_declaration->len))
+ return -EFAULT;
return 0;
}
return 0;
}
@@
-269,7
+275,8
@@
int ctf_integer_write(struct bt_stream_pos *ppos, struct bt_definition *definiti
return _aligned_integer_write(ppos, definition);
}
return _aligned_integer_write(ppos, definition);
}
- ctf_align_pos(pos, integer_declaration->p.alignment);
+ if (!ctf_align_pos(pos, integer_declaration->p.alignment))
+ return -EFAULT;
if (!ctf_pos_access_ok(pos, integer_declaration->len))
return -EFAULT;
if (!ctf_pos_access_ok(pos, integer_declaration->len))
return -EFAULT;
@@
-300,6
+307,7
@@
int ctf_integer_write(struct bt_stream_pos *ppos, struct bt_definition *definiti
integer_definition->value._signed);
}
end:
integer_definition->value._signed);
}
end:
- ctf_move_pos(pos, integer_declaration->len);
+ if (!ctf_move_pos(pos, integer_declaration->len))
+ return -EFAULT;
return 0;
}
return 0;
}
This page took
0.025224 seconds
and
4
git commands to generate.