The accept_boxc() function mishandles denied IP connections. The
code to handle a denied IP connection should be amended to;

    if (is_allowed_ip(box_allow_ip, box_deny_ip, ip) == 0) {
        info(0, "Box connection tried from denied host <%s>, disconnected",
             octstr_get_cstr(ip));
        octstr_destroy(ip);
        close (newfd);
        ^^^^^^^^^^^^^^ Add this line ^^^^^^^^^^
        return NULL;
    }

so that the newfd socket descriptor is closed otherwise;

* There is a resource leak

* The remote client doesn't get a helpful ECONNRESET (?) error to let them
something is wrong.


Paul Keogh
ANAM Wireless Internet Solutions
http://www.anam.com                     
+353 1 284 7555 (wired)               +353 86 234 6047 (wireless)
Castle Yard, Saint Patrick's Road, Dalkey, County Dublin, Ireland
 

Reply via email to