diff options
author | Anthony Ramine <[email protected]> | 2013-10-23 19:17:11 +0200 |
---|---|---|
committer | Anthony Ramine <[email protected]> | 2014-07-02 00:54:27 +0200 |
commit | acf19fc9190985f643af06293141a1083f032563 (patch) | |
tree | 92868549ed3d0925f167a4b917956bda2a2f534c /erts | |
parent | c9e36ab16034bb7fe71f772df6bba22070976bbf (diff) | |
download | otp-acf19fc9190985f643af06293141a1083f032563.tar.gz otp-acf19fc9190985f643af06293141a1083f032563.tar.bz2 otp-acf19fc9190985f643af06293141a1083f032563.zip |
Use offsetof() in io.c
This silences the following UBSan errors:
beam/io.c:7131:27: runtime error: member access within null pointer of type 'ErlDrvSysInfo'
beam/io.c:7140:20: runtime error: member access within null pointer of type 'ErlDrvSysInfo'
beam/io.c:7166:20: runtime error: member access within null pointer of type 'ErlDrvSysInfo'
beam/io.c:7174:20: runtime error: member access within null pointer of type 'ErlDrvSysInfo'
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/beam/io.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c index edf4a28784..c34a5b17d0 100644 --- a/erts/emulator/beam/io.c +++ b/erts/emulator/beam/io.c @@ -7166,7 +7166,7 @@ char *driver_dl_error(void) #define ERL_DRV_SYS_INFO_SIZE(LAST_FIELD) \ - (((size_t) &((ErlDrvSysInfo *) 0)->LAST_FIELD) \ + (offsetof(ErlDrvSysInfo, LAST_FIELD) \ + sizeof(((ErlDrvSysInfo *) 0)->LAST_FIELD)) void |