mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
Do the success checkout out front
This commit is contained in:
@ -782,7 +782,7 @@ int wolfSSL_CertManagerVerify(WOLFSSL_CERT_MANAGER* cm, const char* fname,
|
||||
#ifndef WOLFSSL_SMALL_STACK
|
||||
byte staticBuffer[FILE_BUFFER_SIZE];
|
||||
#endif
|
||||
byte* buff;
|
||||
byte* buff = NULL;
|
||||
long sz = 0;
|
||||
XFILE file = XBADFILE;
|
||||
|
||||
@ -814,16 +814,15 @@ int wolfSSL_CertManagerVerify(WOLFSSL_CERT_MANAGER* cm, const char* fname,
|
||||
* small. */
|
||||
#ifndef WOLFSSL_SMALL_STACK
|
||||
if ((ret == WOLFSSL_SUCCESS) && (sz > (long)sizeof(staticBuffer)))
|
||||
#else
|
||||
|
||||
if (ret == WOLFSSL_SUCCESS)
|
||||
#endif
|
||||
{
|
||||
WOLFSSL_MSG("Getting dynamic buffer");
|
||||
buff = (byte*)XMALLOC((size_t)sz, cm->heap, DYNAMIC_TYPE_FILE);
|
||||
if (buff == NULL) {
|
||||
/* If some other error has already occurred preserve that code
|
||||
* return WOLFSSL_BAD_FILE if that is the only error condition */
|
||||
if (ret == WOLFSSL_SUCCESS) {
|
||||
ret = WOLFSSL_BAD_FILE;
|
||||
}
|
||||
ret = WOLFSSL_BAD_FILE;
|
||||
}
|
||||
}
|
||||
/* Read all the file into buffer. */
|
||||
|
Reference in New Issue
Block a user