Changeset: cc16bb8cb4d8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cc16bb8cb4d8
Modified Files:
        monetdb5/modules/mal/mal_mapi.mx
Branch: Mar2011
Log Message:

SERVERlisten: force maximum tcp port 65535

port isn't checked carefully, leading to unexpected success of opening
invalid ports, bug #2738.
At the same time, fix a case of throwing an IO instead of an ILLARG for
invalid arguments.

Reviewed-by: Fabian Groffen <[email protected]>


diffs (15 lines):

diff --git a/monetdb5/modules/mal/mal_mapi.mx b/monetdb5/modules/mal/mal_mapi.mx
--- a/monetdb5/modules/mal/mal_mapi.mx
+++ b/monetdb5/modules/mal/mal_mapi.mx
@@ -706,7 +706,10 @@
        maxusers = (maxusers ? maxusers : SERVERMAXUSERS);
 
        if (port <= 0 && usockfile == NULL)
-               throw(IO, "mal_mapi.listen", OPERATION_FAILED ": no port or 
socket file specified");
+               throw(ILLARG, "mal_mapi.listen", OPERATION_FAILED ": no port or 
socket file specified");
+       
+       if (port > 65535)
+               throw(ILLARG, "mal_mapi.listen", OPERATION_FAILED ": port 
number should be between 1 and 65535");
 
        if (port > 0) {
                sock = socket(AF_INET, SOCK_STREAM, 0);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to