Fix off-by-one range checks for TCP port numbers

Port numbers should be in the range [0,65535] not [0,65536].  It
looks like the check was changed from 65535 to 65536 in commit
89b9a561ea.
This commit is contained in:
Kris Katterjohn 2017-02-05 13:01:07 -06:00
parent 2779b16b95
commit 6b103ae6d3

View file

@ -277,7 +277,7 @@ si_open_client_stream(cl_object host, cl_object port)
if (ecl_unlikely(!ECL_FIXNUMP(port) ||
ecl_fixnum_minusp(port) ||
ecl_fixnum_greater(port,ecl_make_fixnum(65536)))) {
ecl_fixnum_greater(port,ecl_make_fixnum(65535)))) {
FEwrong_type_nth_arg(@[si::open-client-stream], 2, port,
ecl_read_from_cstring("(INTEGER 0 65535)"));
}
@ -311,7 +311,7 @@ si_open_server_stream(cl_object port)
if (ecl_unlikely(!ECL_FIXNUMP(port) ||
ecl_fixnum_minusp(port) ||
ecl_fixnum_greater(port,ecl_make_fixnum(65536)))) {
ecl_fixnum_greater(port,ecl_make_fixnum(65535)))) {
FEwrong_type_only_arg(@[si::open-client-stream], port,
ecl_read_from_cstring("(INTEGER 0 65535)"));
}