diff options
author | Sverker Eriksson <[email protected]> | 2018-03-14 17:42:46 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2018-03-14 17:42:46 +0100 |
commit | eaf20e4f60ba537733752637c7952eb52e225473 (patch) | |
tree | 93e2bc0eec98c46abed8b5111826b37f3ed231b0 /erts | |
parent | 98d8d18584cffd9bae18f1f9be997ab00fac081e (diff) | |
download | otp-eaf20e4f60ba537733752637c7952eb52e225473.tar.gz otp-eaf20e4f60ba537733752637c7952eb52e225473.tar.bz2 otp-eaf20e4f60ba537733752637c7952eb52e225473.zip |
erts: Fix faulty sys_memcpy of 0 bytes
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/beam/beam_load.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 50498cb6cf..0184c567f1 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -4915,7 +4915,9 @@ freeze_code(LoaderState* stp) line_items[i] = codev + stp->ci - 1; line_tab->fname_ptr = (Eterm*) &line_items[i + 1]; - sys_memcpy(line_tab->fname_ptr, stp->fname, stp->num_fnames*sizeof(Eterm)); + if (stp->num_fnames) + sys_memcpy(line_tab->fname_ptr, stp->fname, + stp->num_fnames*sizeof(Eterm)); line_tab->loc_size = stp->loc_size; if (stp->loc_size == 2) { |