Skip to content

Commit d456784

Browse files
authored
Merge pull request #9361 from douzzer/20251029-NullPointerArithm-fixes
20251029-NullPointerArithm-fixes
2 parents df79b10 + d260493 commit d456784

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/pem/pem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ int main(int argc, char* argv[])
977977
out_len = der->length;
978978
}
979979
}
980-
else {
980+
else if (ret == 0) {
981981
#ifdef WOLFSSL_DER_TO_PEM
982982
#if defined(WOLFSSL_ENCRYPTED_KEYS) && !defined(NO_PWDBASED)
983983
if (enc_der) {

src/internal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10470,7 +10470,7 @@ int HashOutput(WOLFSSL* ssl, const byte* output, int sz, int ivSz)
1047010470
{
1047110471
const byte* adj;
1047210472

10473-
if (ssl->hsHashes == NULL)
10473+
if ((ssl->hsHashes == NULL) || (output == NULL))
1047410474
return BAD_FUNC_ARG;
1047510475

1047610476
adj = output + RECORD_HEADER_SZ + ivSz;

0 commit comments

Comments
 (0)