qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Erik de Castro Lopo <mle+tools@mega-nerd.com>
To: qemu-devel@nongnu.org
Cc: Bruce Rogers <brogers@novell.com>
Subject: Re: [Qemu-devel] [PATCH] fix bad memcpy length
Date: Fri, 24 Oct 2008 09:00:31 +1100	[thread overview]
Message-ID: <20081024090031.c33c1c53.mle+tools@mega-nerd.com> (raw)
In-Reply-To: <49009C800200004800060A7C@lucius.provo.novell.com>

Bruce Rogers wrote:

> --- a/qemu/trunk/hw/bt-sdp.c
> +++ b/qemu/trunk/hw/bt-sdp.c
> @@ -254,7 +254,7 @@
>      /* Perform the search */
>      if (len < 7)
>          return -SDP_INVALID_SYNTAX;
> -    memcpy(&handle, req, 6);
> +    memcpy(&handle, req, 4);

Changing one magic number to another doesn't make much sense.
Why not this instead:

    memcpy(&handle, req, sizeof (handle));

Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"life is too long to know C++ well" -- Erik Naggum

      reply	other threads:[~2008-10-23 22:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-23 21:47 [Qemu-devel] [PATCH] fix bad memcpy length Bruce Rogers
2008-10-23 22:00 ` Erik de Castro Lopo [this message]

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=20081024090031.c33c1c53.mle+tools@mega-nerd.com \
    --to=mle+tools@mega-nerd.com \
    --cc=brogers@novell.com \
    --cc=qemu-devel@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).