aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/unix/erl_child_setup.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2015-08-14 11:51:21 +0200
committerLukas Larsson <[email protected]>2015-12-15 10:05:45 +0100
commit898ca7f86dff3fe21c9bf2e5018c7fb93dca158e (patch)
treebcef30e7264c380d296e28d3d13b99286143cfec /erts/emulator/sys/unix/erl_child_setup.c
parentd5f541904839b0307b1db3a28aace3ea6ba2fd37 (diff)
downloadotp-898ca7f86dff3fe21c9bf2e5018c7fb93dca158e.tar.gz
otp-898ca7f86dff3fe21c9bf2e5018c7fb93dca158e.tar.bz2
otp-898ca7f86dff3fe21c9bf2e5018c7fb93dca158e.zip
erts: Fix dereferencing of unaligned integer for sparc
Diffstat (limited to 'erts/emulator/sys/unix/erl_child_setup.c')
-rw-r--r--erts/emulator/sys/unix/erl_child_setup.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/erts/emulator/sys/unix/erl_child_setup.c b/erts/emulator/sys/unix/erl_child_setup.c
index 71c7948bf0..8bec36be60 100644
--- a/erts/emulator/sys/unix/erl_child_setup.c
+++ b/erts/emulator/sys/unix/erl_child_setup.c
@@ -133,8 +133,8 @@ start_new_child(int pipes[])
o_buff = buff;
- flags = *(int*)buff;
- buff += sizeof(int);
+ flags = get_int32(buff);
+ buff += sizeof(Sint32);
DEBUG_PRINT("flags = %d", flags);
@@ -150,8 +150,8 @@ start_new_child(int pipes[])
DEBUG_PRINT("wd = %s", wd);
- cnt = *(int*)buff;
- buff += sizeof(int);
+ cnt = get_int32(buff);
+ buff += sizeof(Sint32);
new_environ = malloc(sizeof(char*)*(cnt + 1));
for (i = 0; i < cnt; i++, buff++) {
@@ -162,8 +162,8 @@ start_new_child(int pipes[])
if (o_buff + size != buff) {
/* This is a spawn executable call */
- cnt = *(int*)buff;
- buff += sizeof(int);
+ cnt = get_int32(buff);
+ buff += sizeof(Sint32);
args = malloc(sizeof(char*)*(cnt + 1));
for (i = 0; i < cnt; i++, buff++) {
args[i] = buff;