Commit 97e3448
authored
Set ErlNifEntry.min_erts to a placeholder value (#703)
This value was introduced with NIF version 2.14 (so, OTP-21, erts-10.0).
Us leaving it unassigned and defaulting to NIF version 2.15 means the OTP is currently
always putting a random pointer into the respective field here:
https://github.com/erlang/otp/blob/ae81b2f6ff2d541c01242f12cdbd5238aa4b26bd/erts/emulator/beam/erl_nif.c#L4581-L4585
It is used if one tries to load a NIF library that was compiled for a
newer NIF version to display a debug message, at which point it would
perform an out-of-bounds read.
As we currently default to NIF v2.15 (OTP-22) and only have features up
to 2.16 (OTP-24), there are probably very few cases of this actually
occurring in the wild.1 parent 5f34069 commit 97e3448
File tree
3 files changed
+14
-0
lines changed- rustler_codegen/src
- rustler/src
- sys
3 files changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
0 commit comments