the bb_lookup_port() is a library function and I'm not sure if it's fine to die.
There are already some error messages like:
               o_lport = bb_lookup_port(str_p, o_udpmode ? "udp" : "tcp");
                if (!o_lport)
                        bb_error_msg_and_die("bad local port '%s'", str_p);
Also passing a zero port into xhost2sockaddr() will also make process die

On Thu, 9 Sept 2021 at 23:03, Denys Vlasenko <vda.li...@googlemail.com> wrote:
>
> On Wed, Aug 25, 2021 at 10:15 PM Sergey Ponomarev <stok...@gmail.com> wrote:
> > Unlike xatou16() the bb_lookup_port() won't exit program if port parsing is 
> > failed.
> > But it may return a default_port instead. This is not safe because user 
> > requested another port.
> > Instead, we return 0 and caller may gracefully show a message or just pass 
> > it further.
>
> Let's just print the message and die. None of the callers want to continue
> on such an error.



-- 
Sergey Ponomarev, skype:stokito
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to