Skip to content

Commit

Permalink
checked_memcpy_offset: Add const to size_t available_size
Browse files Browse the repository at this point in the history
Reviewed By: csahana95

Differential Revision: D51397286

fbshipit-source-id: 61feed9dd52b5035c3598bbb908e9e537383e315
  • Loading branch information
Daniel Rolf authored and facebook-github-bot committed Nov 17, 2023
1 parent 26ee0ff commit c616cbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/igl/IGLSafeC.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ inline void* checked_memcpy_offset(void* destination,
//
// To avoid this, we properly compute the available_size and then check that.

size_t available_size = offset > destination_size ? 0 : destination_size - offset;
const size_t available_size = offset > destination_size ? 0 : destination_size - offset;

if (count > available_size) {
IGL_REPORT_ERROR_MSG(false, "Aborting due to potential buffer overflow");
Expand Down

0 comments on commit c616cbd

Please sign in to comment.