aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/unix/sys_drivers.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/sys_drivers.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/sys_drivers.c')
-rw-r--r--erts/emulator/sys/unix/sys_drivers.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/erts/emulator/sys/unix/sys_drivers.c b/erts/emulator/sys/unix/sys_drivers.c
index 8402197924..97a9c3dfaa 100644
--- a/erts/emulator/sys/unix/sys_drivers.c
+++ b/erts/emulator/sys/unix/sys_drivers.c
@@ -699,6 +699,7 @@ static ErlDrvData spawn_start(ErlDrvPort port_num, char* name,
io_vector[i++].iov_len = sizeof(buffsz);
io_vector[i].iov_base = (void*)&flags;
+ flags = htonl(flags);
io_vector[i++].iov_len = sizeof(flags);
buffsz += sizeof(flags);
@@ -715,6 +716,7 @@ static ErlDrvData spawn_start(ErlDrvPort port_num, char* name,
buffsz += io_vector[i-1].iov_len;
io_vector[i].iov_base = (void*)&env_len;
+ env_len = htonl(env_len);
io_vector[i++].iov_len = sizeof(env_len);
buffsz += io_vector[i-1].iov_len;
@@ -728,6 +730,7 @@ static ErlDrvData spawn_start(ErlDrvPort port_num, char* name,
if (opts->spawn_type == ERTS_SPAWN_EXECUTABLE) {
io_vector[i].iov_base = (void*)&argv_len;
+ argv_len = htonl(argv_len);
io_vector[i++].iov_len = sizeof(argv_len);
buffsz += io_vector[i-1].iov_len;