Skip to content

Commit

Permalink
fix: cast from void* to uintptr_t inside is_buffer_outside_region
Browse files Browse the repository at this point in the history
  • Loading branch information
gianlu33 committed Oct 26, 2021
1 parent b27b130 commit d57b76d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/sancus_support/sm_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,13 @@ sm_id sancus_enable_wrapped(struct SancusModule* sm, unsigned nonce, void* tag);
* Returns true if buf is outside the memory region [start, end)
* if start >= end, immediately return false
*/
always_inline int is_buffer_outside_region(uintptr_t start, uintptr_t end,
uintptr_t buf, size_t len) {
always_inline int is_buffer_outside_region(void *start_p, void *end_p,
void *buf_p, size_t len) {
uintptr_t start = (uintptr_t) start_p;
uintptr_t end = (uintptr_t) end_p;
uintptr_t buf = (uintptr_t) buf_p;
uintptr_t buf_end;

// make sure start < end, otherwise return false
if (start >= end) {
return 0;
Expand Down

0 comments on commit d57b76d

Please sign in to comment.