aboutsummaryrefslogtreecommitdiff
path: root/rpc_misc.c
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2018-10-23 18:01:02 -0400
committerPaul Selkirk <paul@psgd.org>2018-10-25 17:16:10 -0400
commit2b4972ee5c17b64162333fdd1d023158e35c8c1a (patch)
tree8f177275758482779eb6225b9fdfb5766996967d /rpc_misc.c
parent7219e78b554a7b7e792a344b0c6cf133affe88b2 (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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rpc_misc.c b/rpc_misc.c
index c27913c..50ee3ac 100644
--- a/rpc_misc.c
+++ b/rpc_misc.c
@@ -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);