From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: Re: [PATCH] pv-grub: correct sizeof usage Date: Sun, 30 Mar 2014 09:29:44 +0200 Message-ID: <20140330072944.GS4954@type> References: <1396069688-5880-1-git-send-email-mattd@bugfuzz.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <1396069688-5880-1-git-send-email-mattd@bugfuzz.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Matthew Daley Cc: xen-devel@lists.xenproject.org, xen-devel@lists.xen.org, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Matthew Daley, le Sat 29 Mar 2014 18:08:08 +1300, a =E9crit : > We were lucky that sizeof(frame) >=3D sizeof(*frame) anyway. Ouch, indeed! > Signed-off-by: Matthew Daley Signed-off-by: Samuel Thibault > --- > stubdom/grub/mini-os.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > = > diff --git a/stubdom/grub/mini-os.c b/stubdom/grub/mini-os.c > index 64ab962..9d4bcc7 100644 > --- a/stubdom/grub/mini-os.c > +++ b/stubdom/grub/mini-os.c > @@ -333,7 +333,7 @@ struct frame { > static void minios_transmit (struct nic *nic, const char *d, unsigned in= t t, > unsigned int s, const char *p) > { > - struct frame *frame =3D alloca(sizeof(frame) + s); > + struct frame *frame =3D alloca(sizeof(*frame) + s); > = > memcpy(frame->dest, d, ETH_ALEN); > memcpy(frame->src, nic->node_addr, ETH_ALEN); > -- = > 1.9.0 > = -- = Samuel N: j'aime bien Cut d'un truc enorme... ca montre de quel cote de l'ecra= n sont les couilles :))) -+- #ens-mim et la peufeupeu -+-