From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Daley Subject: [PATCH] pv-grub: correct sizeof usage Date: Sat, 29 Mar 2014 18:08:08 +1300 Message-ID: <1396069688-5880-1-git-send-email-mattd@bugfuzz.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WTlVO-0007YF-GR for xen-devel@lists.xenproject.org; Sat, 29 Mar 2014 05:08:30 +0000 Received: by mail-pa0-f46.google.com with SMTP id kx10so385707pab.33 for ; Fri, 28 Mar 2014 22:08:27 -0700 (PDT) List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Samuel Thibault , Matthew Daley , xen-devel@lists.xen.org, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org We were lucky that sizeof(frame) >= sizeof(*frame) anyway. Signed-off-by: Matthew Daley --- 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 int t, unsigned int s, const char *p) { - struct frame *frame = alloca(sizeof(frame) + s); + struct frame *frame = alloca(sizeof(*frame) + s); memcpy(frame->dest, d, ETH_ALEN); memcpy(frame->src, nic->node_addr, ETH_ALEN); -- 1.9.0