qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <mlureau@redhat.com>
To: arei gonglei <arei.gonglei@huawei.com>
Cc: qemu-trivial@nongnu.org,
	marcandre lureau <marcandre.lureau@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] ivshmem-server: fix possible OVERRUN
Date: Mon, 2 Nov 2015 09:20:32 -0500 (EST)	[thread overview]
Message-ID: <1638142759.891037.1446474032692.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1446426828-18084-1-git-send-email-arei.gonglei@huawei.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

----- Original Message -----
> From: Gonglei <arei.gonglei@huawei.com>
> 
> >>>     CID 1337991:  Memory - illegal accesses  (OVERRUN)
> >>>     Decrementing "i". The value of "i" is now 65534.
> 218         while (i--) {
> 219             event_notifier_cleanup(&peer->vectors[i]);
> 220         }
> 
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
>  contrib/ivshmem-server/ivshmem-server.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/contrib/ivshmem-server/ivshmem-server.c
> b/contrib/ivshmem-server/ivshmem-server.c
> index 5e5239c..d9e26b0 100644
> --- a/contrib/ivshmem-server/ivshmem-server.c
> +++ b/contrib/ivshmem-server/ivshmem-server.c
> @@ -168,7 +168,9 @@ ivshmem_server_handle_new_conn(IvshmemServer *server)
>      }
>      if (i == G_MAXUINT16) {
>          IVSHMEM_SERVER_DEBUG(server, "cannot allocate new client id\n");
> -        goto fail;
> +        close(newfd);
> +        g_free(peer);
> +        return -1;
>      }
>      peer->id = server->cur_id++;
>  
> --
> 1.7.12.4
> 
> 
> 

  reply	other threads:[~2015-11-02 14:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-02  1:13 [Qemu-devel] [PATCH] ivshmem-server: fix possible OVERRUN arei.gonglei
2015-11-02 14:20 ` Marc-André Lureau [this message]
2015-11-03 12:14 ` Michael Tokarev

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=1638142759.891037.1446474032692.JavaMail.zimbra@redhat.com \
    --to=mlureau@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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).