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

Stipe Tolj <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Wapme Systems AG
Message-ID <[email protected]>
Paul Keogh wrote:
> 
> 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.

commited to cvs, thanks Paul.

Stipe

[email protected]
-------------------------------------------------------------------
Wapme Systems AG

Münsterstr. 248
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [email protected]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are
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.