Commit b6e960f
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: nodejs#25247
PR-URL: nodejs#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 ac5ffbe commit b6e960f
2 files changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2696 | 2696 | | |
2697 | 2697 | | |
2698 | 2698 | | |
2699 | | - | |
| 2699 | + | |
2700 | 2700 | | |
2701 | 2701 | | |
2702 | 2702 | | |
| |||
2854 | 2854 | | |
2855 | 2855 | | |
2856 | 2856 | | |
2857 | | - | |
| 2857 | + | |
| 2858 | + | |
2858 | 2859 | | |
2859 | 2860 | | |
2860 | 2861 | | |
| |||
2869 | 2870 | | |
2870 | 2871 | | |
2871 | 2872 | | |
2872 | | - | |
| 2873 | + | |
| 2874 | + | |
2873 | 2875 | | |
2874 | 2876 | | |
2875 | 2877 | | |
| |||
| 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