From 02565089e3747a0f85125647b8ad2467e4c2b36d Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 5 Sep 2016 16:32:46 +0200 Subject: erts: Reject beam file with too few functions --- erts/emulator/beam/beam_load.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'erts/emulator/beam') 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; -- cgit v1.2.3