qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@gnu.org>
To: William Bowling <will@wbowling.info>
Cc: qemu-devel@nongnu.org, secalert@redhat.com
Subject: Re: [Qemu-devel] [PATCH] slirp: check sscanf result when emulating ident
Date: Fri, 1 Mar 2019 18:21:08 -0800	[thread overview]
Message-ID: <20190302022108.tfhnu4kdgnujjpwq@function> (raw)
In-Reply-To: <1551476756-25749-1-git-send-email-will@wbowling.info>

William Bowling, le ven. 01 mars 2019 21:45:56 +0000, a ecrit:
> When emulating ident in tcp_emu, if the strchr checks passed but the
> sscanf check failed, two uninitialized variables would be copied and
> sent in the reply.
> 
> Signed-off-by: William Bowling <will@wbowling.info>

Applied to my tree, thanks!

> ---
>  slirp/tcp_subr.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
> index 262a42d6c8..73a160ba16 100644
> --- a/slirp/tcp_subr.c
> +++ b/slirp/tcp_subr.c
> @@ -664,12 +664,12 @@ tcp_emu(struct socket *so, struct mbuf *m)
>  							break;
>  						}
>  					}
> -				}
> -                                so_rcv->sb_cc = snprintf(so_rcv->sb_data,
> -                                                         so_rcv->sb_datalen,
> -                                                         "%d,%d\r\n", n1, n2);
> -				so_rcv->sb_rptr = so_rcv->sb_data;
> -				so_rcv->sb_wptr = so_rcv->sb_data + so_rcv->sb_cc;
> +                    so_rcv->sb_cc = snprintf(so_rcv->sb_data,
> +                                             so_rcv->sb_datalen,
> +                                             "%d,%d\r\n", n1, n2);
> +                    so_rcv->sb_rptr = so_rcv->sb_data;
> +                    so_rcv->sb_wptr = so_rcv->sb_data + so_rcv->sb_cc;
> +                }
>  			}
>  			m_free(m);
>  			return 0;
> -- 
> 2.15.1
> 
> 

-- 
Samuel
What's this script do?
    unzip ; touch ; finger ; mount ; gasp ; yes ; umount ; sleep
Hint for the answer: not everything is computer-oriented. Sometimes you're
in a sleeping bag, camping out.
(Contributed by Frans van der Zande.)

  reply	other threads:[~2019-03-02  2:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01 21:45 [Qemu-devel] [PATCH] slirp: check sscanf result when emulating ident William Bowling
2019-03-02  2:21 ` Samuel Thibault [this message]
2019-03-02 17:42 ` Philippe Mathieu-Daudé
2019-03-02 17:49   ` Samuel Thibault
2019-03-02 23:28   ` William Bowling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190302022108.tfhnu4kdgnujjpwq@function \
    --to=samuel.thibault@gnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=secalert@redhat.com \
    --cc=will@wbowling.info \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).