diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/keymaster/serializable.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/keymaster/serializable.h b/include/keymaster/serializable.h index a7cce83..6dd31b2 100644 --- a/include/keymaster/serializable.h +++ b/include/keymaster/serializable.h @@ -173,7 +173,7 @@ inline bool copy_uint32_array_from_buf(const uint8_t** buf_ptr, const uint8_t* e return false; const uint8_t* array_end = *buf_ptr + *count * sizeof(uint32_t); - if (array_end < *buf_ptr || array_end > end) + if (*count >= UINT32_MAX / sizeof(uint32_t) || array_end < *buf_ptr || array_end > end) return false; data->reset(new (std::nothrow) T[*count]); |