src/internal.c: in HashOutput(), check for null output pointer;

examples/pem/pem.c: in main(), add missing check that ret == 0 in _DER_TO_PEM code path.
This commit is contained in:
Daniel Pouzzner
2025-10-29 10:04:24 -05:00
parent df79b1062f
commit d260493642
2 changed files with 2 additions and 2 deletions

View File

@@ -977,7 +977,7 @@ int main(int argc, char* argv[])
out_len = der->length;
}
}
else {
else if (ret == 0) {
#ifdef WOLFSSL_DER_TO_PEM
#if defined(WOLFSSL_ENCRYPTED_KEYS) && !defined(NO_PWDBASED)
if (enc_der) {

View File

@@ -10470,7 +10470,7 @@ int HashOutput(WOLFSSL* ssl, const byte* output, int sz, int ivSz)
{
const byte* adj;
if (ssl->hsHashes == NULL)
if ((ssl->hsHashes == NULL) || (output == NULL))
return BAD_FUNC_ARG;
adj = output + RECORD_HEADER_SZ + ivSz;