From da6ed416be5d157c078600fb0407f6080059956b Mon Sep 17 00:00:00 2001 From: Hideki Miyazaki Date: Tue, 25 Jun 2019 08:39:46 +0900 Subject: [PATCH] use len for copy-length instead of sz --- wolfcrypt/src/random.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 0db43f0ec..41b4ef359 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -2182,7 +2182,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) len = sz; /* Get one random 32-bit word from hw RNG */ rand = esp_random( ); - XMEMCPY(output, &rand, sz); + XMEMCPY(output, &rand, len); output += len; sz -= len; } @@ -2228,7 +2228,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) if (sz < len) len = sz; rand = sys_rand32_get(); - XMEMCPY(output, &rand, sz); + XMEMCPY(output, &rand, len); output += len; sz -= len; }