BUG [gw/bb_boxc.c/accept_boxc()]

"Paul Keogh" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.