[openssl/openssl] 5f61ae: Fix memory leak in PKCS12_parse

"'Adam Tabak' via openssl-commits" <[email protected]>
Newsgroups gmane.comp.encryption.openssl.cvs
Message-ID <openssl/openssl/push/refs/heads/master/[email protected]>
  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 5f61ae81549a6872869469bcb2784cdc08be9271
      https://github.com/openssl/openssl/commit/5f61ae81549a6872869469bcb2784cdc08be9271
  Author: Greensi7 <[email protected]>
  Date:   2026-08-27 (Thu, 27 Aug 2026)

  Changed paths:
    M crypto/pkcs12/p12_kiss.c
    M doc/man3/PKCS12_parse.pod
    M test/pkcs12_api_test.c

  Log Message:
  -----------
  Fix memory leak in PKCS12_parse

If appending an additional certificate to the CA stack fails
PKCS12_parse() leaves certificates appended earlier during the call
in the output stack. If PKCS12_parse() allocated the stack
then the whole stack might be leaked if caller assumes failure.

Fix:
Record the original stack and its size then on failure
remove certificates appended during the failed call.
Free the stack if it was allocated by PKCS12_parse().

Found by : store fuzzer (MFAIL-test)

Assisted-by: ChatGPT:gpt-5.6
Reviewed-by: Dmitry Belyavskiy <[email protected]>
Reviewed-by: Mounir Idrassi <[email protected]>
Merge-date: Thu Aug 27 16:49:42 2026
Merged-from: https://github.com/openssl/openssl/pull/32407



To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups "openssl-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-commits/openssl/openssl/push/refs/heads/master/96b16b-5f61ae%40github.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.