Fixed CID 577295.

This commit is contained in:
Martin Kinčl 2021-03-03 21:20:33 +01:00
parent c634c6c850
commit 3770d4c581

View File

@ -386,7 +386,10 @@ int wc_FileLoad(const char* fname, unsigned char** buf, size_t* bufLen,
return BAD_PATH_ERROR;
}
XFSEEK(f, 0, XSEEK_END);
if (XFSEEK(f, 0, XSEEK_END) != 0) {
WOLFSSL_MSG("wc_LoadFile file seek error");
return BAD_PATH_ERROR;
}
fileSz = XFTELL(f);
XREWIND(f);
if (fileSz > 0) {