Unverified Commit fe5b8dca authored by Tobias Nießen's avatar Tobias Nießen Committed by Anna Henningsen
Browse files

crypto: fix zero byte allocation assertion failure

When an empty string was passed, malloc might have returned a nullptr
depending on the platform, causing an assertion failure. This change
makes private key parsing behave as public key parsing does, causing
a BIO error instead that can be caught in JS.

Fixes: https://github.com/nodejs/node/issues/25247

PR-URL: https://github.com/nodejs/node/pull/25248


Reviewed-By: default avatarUjjwal Sharma <usharma1998@gmail.com>
Reviewed-By: default avatarBen Noordhuis <info@bnoordhuis.nl>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
parent 54fa59c8
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment