diff options
author | Sverker Eriksson <[email protected]> | 2016-09-05 16:32:46 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-09-05 16:32:46 +0200 |
commit | 02565089e3747a0f85125647b8ad2467e4c2b36d (patch) | |
tree | ad57f07020f26a1e6131ea6c6d26e293ef198c4d /erts/emulator | |
parent | 076098cebd1885ec5a56575d910322a6f1de67ff (diff) | |
download | otp-02565089e3747a0f85125647b8ad2467e4c2b36d.tar.gz otp-02565089e3747a0f85125647b8ad2467e4c2b36d.tar.bz2 otp-02565089e3747a0f85125647b8ad2467e4c2b36d.zip |
erts: Reject beam file with too few functions
Diffstat (limited to 'erts/emulator')
-rw-r--r-- | erts/emulator/beam/beam_load.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index b7e802775d..f63addb309 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -2635,6 +2635,10 @@ load_code(LoaderState* stp) * End of code found. */ case op_int_code_end: + if (function_number != stp->num_functions) { + LoadError2(stp, "too few functions (%u) in module (header said %u)", + function_number, stp->num_functions); + } stp->codev_size = codev_size; stp->ci = ci; stp->function = THE_NON_VALUE; |