diff options
author | Sverker Eriksson <[email protected]> | 2019-01-28 17:36:31 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2019-01-28 19:43:24 +0100 |
commit | ad5822c6b1401111bbdbc5e77fe097a3f1b2b3cb (patch) | |
tree | 2d8520bde623c7aeb6812f4fe63a597467812e79 /erts/emulator/drivers/win32/ttsl_drv.c | |
parent | a4aeacd28e4e31d3d79b091afcdc528082be2865 (diff) | |
download | otp-ad5822c6b1401111bbdbc5e77fe097a3f1b2b3cb.tar.gz otp-ad5822c6b1401111bbdbc5e77fe097a3f1b2b3cb.tar.bz2 otp-ad5822c6b1401111bbdbc5e77fe097a3f1b2b3cb.zip |
erts: Add magic port control numbers
to increase the probablity of a nice badarg
from erlang:port_control.
Diffstat (limited to 'erts/emulator/drivers/win32/ttsl_drv.c')
-rw-r--r-- | erts/emulator/drivers/win32/ttsl_drv.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/erts/emulator/drivers/win32/ttsl_drv.c b/erts/emulator/drivers/win32/ttsl_drv.c index 99e7fb25a4..d19bfa3079 100644 --- a/erts/emulator/drivers/win32/ttsl_drv.c +++ b/erts/emulator/drivers/win32/ttsl_drv.c @@ -176,6 +176,8 @@ static ErlDrvSSizeT ttysl_control(ErlDrvData drv_data, { char resbuff[2*sizeof(Uint32)]; ErlDrvSizeT res_size; + + command -= ERTS_TTYSL_DRV_CONTROL_MAGIC_NUMBER; switch (command) { case CTRL_OP_GET_WINSIZE: { @@ -201,7 +203,7 @@ static ErlDrvSSizeT ttysl_control(ErlDrvData drv_data, } break; default: - return 0; + return -1; } if (rlen < res_size) { *rbuf = driver_alloc(res_size); |