[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] lpd: fix null pointer dereferencing on EOF
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2019-06-07 7:15:36
Message-ID: CAK1hOcMJ9s5H4sB1Hxt6pAdPiH_Kj2FNQz=FpV=xwcoBsDQR5Q () mail ! gmail ! com
[Download RAW message or body]

applied, thanks

On Thu, Jun 6, 2019 at 2:06 PM Luís Marques <luismarques@lowrisc.org> wrote:
>
> This one fixes a crash if you run busybox lpd < /dev/null
>
> diff --git a/printutils/lpd.c b/printutils/lpd.c
> index ce5944026..408695f39 100644
> --- a/printutils/lpd.c
> +++ b/printutils/lpd.c
> @@ -133,6 +133,8 @@ int lpd_main(int argc UNUSED_PARAM, char *argv[])
>
>      // read command
>      s = queue = xmalloc_read_stdin();
> +    if (!s)
> +        return EXIT_SUCCESS;
>      // we understand only "receive job" command
>      if (2 != *queue) {
>   unsupported_cmd:
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic