From 899e7ba66b07b13cde6cef6f40d6ee81f40aacff Mon Sep 17 00:00:00 2001 From: jgarcia Date: Wed, 1 Nov 2006 17:46:19 +0000 Subject: [PATCH] Restrict further the port range (as specified by open standards) --- src/c/tcp.d | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/c/tcp.d b/src/c/tcp.d index 65285f218..f8456e9e6 100644 --- a/src/c/tcp.d +++ b/src/c/tcp.d @@ -269,8 +269,7 @@ si_open_client_stream(cl_object host, cl_object port) /* Ensure "host" is a string that we can pass to a C function */ host = si_copy_to_simple_base_string(host); - /* The port number is not negative */ - p = fixnnint(port); + p = ecl_fixnum_in_range(@'si::open-client-stream',"port",port,0,65535); if (host->base_string.fillp > BUFSIZ - 1) FEerror("~S is a too long file name.", 1, host); @@ -295,10 +294,12 @@ cl_object si_open_server_stream(cl_object port) { int fd; /* file descriptor */ + cl_index p; cl_object output; start_critical_section(); - fd = create_server_port(fixnnint(port)); + p = ecl_fixnum_in_range(@'si::open-client-stream',"port",port,0,65535); + fd = create_server_port(p); end_critical_section(); if (fd == 0)