diff options
author | John Högberg <[email protected]> | 2018-03-12 11:38:30 +0100 |
---|---|---|
committer | John Högberg <[email protected]> | 2018-03-12 11:38:30 +0100 |
commit | 2960c7d08932b718dc93773e0718cd214277e09d (patch) | |
tree | 93e755c0f61d3ba73fe0d3c866e23355a82059ca /erts/emulator/beam/erl_drv_thread.c | |
parent | 0217dbfee505ed8c88164c7a4ea5e1834e6ce8cd (diff) | |
parent | 4d4629605ab7d3c3a5268502dadcf639151d6c42 (diff) | |
download | otp-2960c7d08932b718dc93773e0718cd214277e09d.tar.gz otp-2960c7d08932b718dc93773e0718cd214277e09d.tar.bz2 otp-2960c7d08932b718dc93773e0718cd214277e09d.zip |
Merge branch 'john/erts/assert-on-memcpy-memset-etc'
* john/erts/assert-on-memcpy-memset-etc:
Always use sys_memcpy/cmp/etc instead of plain memcpy/cmp/etc
Check the arguments to sys_memcpy and friends
Diffstat (limited to 'erts/emulator/beam/erl_drv_thread.c')
-rw-r--r-- | erts/emulator/beam/erl_drv_thread.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/erts/emulator/beam/erl_drv_thread.c b/erts/emulator/beam/erl_drv_thread.c index 71d4534ef9..4cf42fce57 100644 --- a/erts/emulator/beam/erl_drv_thread.c +++ b/erts/emulator/beam/erl_drv_thread.c @@ -439,7 +439,7 @@ erl_drv_tsd_key_create(char *name, ErlDrvTSDKey *key) name_copy = no_name; else { name_copy = erts_alloc_fnf(ERTS_ALC_T_DRV_TSD, - sizeof(char)*(strlen(name) + 1)); + sizeof(char)*(sys_strlen(name) + 1)); if (!name_copy) { *key = -1; return ENOMEM; @@ -750,7 +750,7 @@ erl_drv_steal_main_thread(char *name, + (name ? sys_strlen(name) + 1 : 0))); if (!dtid) return ENOMEM; - memset(dtid,0,sizeof(ErlDrvTid_)); + sys_memset(dtid,0,sizeof(ErlDrvTid_)); dtid->tid = (void * ) -1; dtid->drv_thr = 1; dtid->func = func; @@ -763,8 +763,8 @@ erl_drv_steal_main_thread(char *name, *tid = NULL; /* Ignore options and name... */ - memcpy(buff,&func,sizeof(void* (*)(void*))); - memcpy(buff + sizeof(void* (*)(void*)),&arg,sizeof(void *)); + sys_memcpy(buff,&func,sizeof(void* (*)(void*))); + sys_memcpy(buff + sizeof(void* (*)(void*)),&arg,sizeof(void *)); write(erts_darwin_main_thread_pipe[1],buff,buff_sz); return 0; } |