aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-09-07 16:33:09 +0200
committerSverker Eriksson <[email protected]>2015-09-07 16:33:09 +0200
commitefa86bac1cdac245213183574eca5f4662e80c7f (patch)
tree6bb61bf0d6da1d6857ce497f414d29f2738ca991 /erts
parent6b4c2dbd1b4a30f421611987acec6315c62ac9d5 (diff)
downloadotp-efa86bac1cdac245213183574eca5f4662e80c7f.tar.gz
otp-efa86bac1cdac245213183574eca5f4662e80c7f.tar.bz2
otp-efa86bac1cdac245213183574eca5f4662e80c7f.zip
erts: Fix inet packet mode ssl_tls for passive mode
Caused stack corruption leading to VM crash on windows. {packet,ssl_tls} is undocumented by the way.
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/drivers/common/inet_drv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c
index 549de6503c..89b71aa66a 100644
--- a/erts/emulator/drivers/common/inet_drv.c
+++ b/erts/emulator/drivers/common/inet_drv.c
@@ -2749,7 +2749,7 @@ int ssl_tls_inetdrv(void* arg, unsigned type, unsigned major, unsigned minor,
{
tcp_descriptor* desc = (tcp_descriptor*) arg;
int i = 0;
- ErlDrvTermData spec[28];
+ ErlDrvTermData spec[30];
ErlDrvTermData caller = ERL_DRV_NIL;
ErlDrvBinary* bin;
int ret;
@@ -2790,11 +2790,11 @@ int ssl_tls_inetdrv(void* arg, unsigned type, unsigned major, unsigned minor,
if (desc->inet.active == INET_PASSIVE) {
i = LOAD_TUPLE(spec, i, 2);
i = LOAD_TUPLE(spec, i, 4);
- ASSERT(i <= 28);
+ ASSERT(i <= sizeof(spec)/sizeof(*spec));
ret = erl_drv_send_term(desc->inet.dport, caller, spec, i);
}
else {
- ASSERT(i <= 28);
+ ASSERT(i <= sizeof(spec)/sizeof(*spec));
ret = erl_drv_output_term(desc->inet.dport, spec, i);
}
done: