aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-03-14 17:42:46 +0100
committerSverker Eriksson <[email protected]>2018-03-14 17:42:46 +0100
commiteaf20e4f60ba537733752637c7952eb52e225473 (patch)
tree93e2bc0eec98c46abed8b5111826b37f3ed231b0 /erts/emulator
parent98d8d18584cffd9bae18f1f9be997ab00fac081e (diff)
downloadotp-eaf20e4f60ba537733752637c7952eb52e225473.tar.gz
otp-eaf20e4f60ba537733752637c7952eb52e225473.tar.bz2
otp-eaf20e4f60ba537733752637c7952eb52e225473.zip
erts: Fix faulty sys_memcpy of 0 bytes
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/beam_load.c4
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) {