Scan-Build Fixes

1. Fix some potential uninitialized pointer errors in the functions sp_RsaPublic_2048, sp_RsaPublic_3072, and sp_RsaPublic_4096 for small stack builds.

To recreate:
    $ scan-build ./configure --enable-sp=small --enable-smallstack --enable-smallstackcache CPPFLAGS="-DECC_CACHE_CURVE -DHAVE_WOLF_BIGINT"
This commit is contained in:
John Safranek 2020-11-12 11:59:01 -08:00
parent 1e348b991d
commit 28be1d0cb3
No known key found for this signature in database
GPG Key ID: 8CE817DE0D3CCB4A
2 changed files with 18 additions and 18 deletions

View File

@ -3203,9 +3203,9 @@ int sp_RsaPublic_2048(const byte* in, word32 inLen, mp_int* em, mp_int* mm,
{
#ifdef WOLFSSL_SP_SMALL
sp_digit* d = NULL;
sp_digit* a;
sp_digit* m;
sp_digit* r;
sp_digit* a = NULL;
sp_digit* m = NULL;
sp_digit* r = NULL;
sp_digit* norm;
sp_digit e[1] = {0};
sp_digit mp;
@ -7090,9 +7090,9 @@ int sp_RsaPublic_3072(const byte* in, word32 inLen, mp_int* em, mp_int* mm,
{
#ifdef WOLFSSL_SP_SMALL
sp_digit* d = NULL;
sp_digit* a;
sp_digit* m;
sp_digit* r;
sp_digit* a = NULL;
sp_digit* m = NULL;
sp_digit* r = NULL;
sp_digit* norm;
sp_digit e[1] = {0};
sp_digit mp;
@ -11144,9 +11144,9 @@ int sp_RsaPublic_4096(const byte* in, word32 inLen, mp_int* em, mp_int* mm,
{
#ifdef WOLFSSL_SP_SMALL
sp_digit* d = NULL;
sp_digit* a;
sp_digit* m;
sp_digit* r;
sp_digit* a = NULL;
sp_digit* m = NULL;
sp_digit* r = NULL;
sp_digit* norm;
sp_digit e[1] = {0};
sp_digit mp;

View File

@ -2843,9 +2843,9 @@ int sp_RsaPublic_2048(const byte* in, word32 inLen, mp_int* em, mp_int* mm,
{
#ifdef WOLFSSL_SP_SMALL
sp_digit* d = NULL;
sp_digit* a;
sp_digit* m;
sp_digit* r;
sp_digit* a = NULL;
sp_digit* m = NULL;
sp_digit* r = NULL;
sp_digit* norm;
sp_digit e[1] = {0};
sp_digit mp;
@ -7005,9 +7005,9 @@ int sp_RsaPublic_3072(const byte* in, word32 inLen, mp_int* em, mp_int* mm,
{
#ifdef WOLFSSL_SP_SMALL
sp_digit* d = NULL;
sp_digit* a;
sp_digit* m;
sp_digit* r;
sp_digit* a = NULL;
sp_digit* m = NULL;
sp_digit* r = NULL;
sp_digit* norm;
sp_digit e[1] = {0};
sp_digit mp;
@ -11403,9 +11403,9 @@ int sp_RsaPublic_4096(const byte* in, word32 inLen, mp_int* em, mp_int* mm,
{
#ifdef WOLFSSL_SP_SMALL
sp_digit* d = NULL;
sp_digit* a;
sp_digit* m;
sp_digit* r;
sp_digit* a = NULL;
sp_digit* m = NULL;
sp_digit* r = NULL;
sp_digit* norm;
sp_digit e[1] = {0};
sp_digit mp;