diff options
author | Paul Selkirk <paul@psgd.org> | 2018-10-23 18:01:02 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2018-10-25 17:16:10 -0400 |
commit | 2b4972ee5c17b64162333fdd1d023158e35c8c1a (patch) | |
tree | 8f177275758482779eb6225b9fdfb5766996967d /rpc_misc.c | |
parent | 7219e78b554a7b7e792a344b0c6cf133affe88b2 (diff) |
Add buffer overflow checks before allocating stack arrays.
This fixes CT-01-005: OOB writes through dynamic stack allocations (Critical)
Diffstat (limited to 'rpc_misc.c')
-rw-r--r-- | rpc_misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -44,7 +44,7 @@ static hal_error_t get_version(uint32_t *version) static hal_error_t get_random(void *buffer, const size_t length) { - if (buffer == NULL || length == 0) + if (buffer == NULL) return HAL_ERROR_IMPOSSIBLE; return hal_get_random(NULL, buffer, length); |