Commit f3ebc39
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: #25247
PR-URL: #25248
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>1 parent b0b1414 commit f3ebc39Copy full SHA for f3ebc39
File tree
Expand file treeCollapse file tree
2 files changed
+12
-3
lines changedOpen diff view settings
Filter options
- src
- test/parallel
Expand file treeCollapse file tree
2 files changed
+12
-3
lines changedOpen diff view settings
Collapse file
+5-3Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2669 | 2669 | |
2670 | 2670 | |
2671 | 2671 | |
2672 | | - |
| 2672 | + |
2673 | 2673 | |
2674 | 2674 | |
2675 | 2675 | |
| ||
2827 | 2827 | |
2828 | 2828 | |
2829 | 2829 | |
2830 | | - |
| 2830 | + |
| 2831 | + |
2831 | 2832 | |
2832 | 2833 | |
2833 | 2834 | |
| ||
2842 | 2843 | |
2843 | 2844 | |
2844 | 2845 | |
2845 | | - |
| 2846 | + |
| 2847 | + |
2846 | 2848 | |
2847 | 2849 | |
2848 | 2850 | |
|
Collapse file
test/parallel/test-crypto-key-objects.js
Copy file name to clipboardExpand all lines: test/parallel/test-crypto-key-objects.js+7Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
105 | 105 | |
106 | 106 | |
107 | 107 | |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
0 commit comments