From 449f8cb91c0b65f83980a833d50d34111a8f038e Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 12 Oct 2010 17:14:00 +0200 Subject: Fix erl_drv_tsd_get() and enif_tsd_get() A bug in erl_drv_tsd_get() and enif_tsd_get() could cause an emulator crash. These functions are currently not used in OTP. That is, the crash only occur on systems with user implemented NIF libraries or drivers that use one of these functions. --- erts/emulator/beam/erl_drv_thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/emulator/beam/erl_drv_thread.c') diff --git a/erts/emulator/beam/erl_drv_thread.c b/erts/emulator/beam/erl_drv_thread.c index d42820ddf3..17b08a71d4 100644 --- a/erts/emulator/beam/erl_drv_thread.c +++ b/erts/emulator/beam/erl_drv_thread.c @@ -528,7 +528,7 @@ erl_drv_tsd_get(ErlDrvTSDKey key) if (!dtid) return NULL; #endif - if (ERL_DRV_TSD_LEN__ < key) + if (ERL_DRV_TSD_LEN__ <= key) return NULL; return ERL_DRV_TSD__[key]; } -- cgit v1.2.3