Commit dc384f9
crypto: fix handling of null BUF_MEM* in ToV8Value()
The assignment to `bptr` calls `BIO_get_mem_ptr` which can fail and
leave the `bptr` as nullptr. This then later causes a null pointer
deref.
This is inconsistent with uses of the similar function
`BIO_get_mem_data` that do check its return value, e.g.
`node::crypto::X509sToArrayOfStrings()`.
Solve it by checking for a null pointer and handling the `Nothing`
return value at the call sites.
PR-URL: #61885
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>1 parent 705bbd6 commit dc384f9Copy full SHA for dc384f9
2 files changed
+14-1Lines changed: 14 additions & 1 deletion
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- src/crypto
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+8-1Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
86 | 86 | |
87 | 87 | |
88 | 88 | |
89 | | - |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
90 | 93 | |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
91 | 98 | |
92 | 99 | |
93 | 100 | |
|
Collapse file
+6Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
106 | 106 | |
107 | 107 | |
108 | 108 | |
| 109 | + |
| 110 | + |
109 | 111 | |
110 | 112 | |
111 | 113 | |
| ||
120 | 122 | |
121 | 123 | |
122 | 124 | |
| 125 | + |
| 126 | + |
123 | 127 | |
124 | 128 | |
125 | 129 | |
| ||
134 | 138 | |
135 | 139 | |
136 | 140 | |
| 141 | + |
| 142 | + |
137 | 143 | |
138 | 144 | |
139 | 145 | |
|
0 commit comments