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 <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>1 parent b0b1414 commit f3ebc39
2 files changed
+12
-3
lines changed| 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 | | |
| |||
| 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