From 33ab901b3f0fd3434df1c7a8023a29b0cfcabc7a Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Mon, 24 Oct 2016 16:44:43 -0600 Subject: [PATCH] prevent allocation of size 0 --- src/internal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index 2a5fd3eb7..8df33f987 100755 --- a/src/internal.c +++ b/src/internal.c @@ -17564,7 +17564,7 @@ int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx, #ifndef NO_RSA case rsa_sa_algo: { - if (verifySig == NULL) { + if (verifySig == NULL && ssl->sigLen > 0) { verifySig = (byte*)XMALLOC(ssl->sigLen, ssl->heap, DYNAMIC_TYPE_TMP_BUFFER); if (!verifySig) { @@ -17610,7 +17610,7 @@ int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx, break; } - if (verifySig == NULL) { + if (verifySig == NULL && ssl->sigLen > 0) { verifySig = (byte*)XMALLOC(ssl->sigLen, ssl->heap, DYNAMIC_TYPE_TMP_BUFFER); if (!verifySig) {