pv-grub: correct sizeof usage
PATCH 1/1 pv-grub: correct sizeof usage
We were lucky that sizeof(frame) >= sizeof(*frame) anyway.
Signed-off-by Matthew Daley <[email protected]>
--- stubdom/grub/mini-os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
stubdom/grub/mini-os.c +1 -1
@@ -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 );
Signature · 1 line
1.9.0
Quoted 1 line · Matthew Daley, le Sat 29 Mar 2014 18:08:08 +1300, a écrit :
We were lucky that sizeof(frame) >=
sizeof(*frame)anyway.
Ouch, indeed!
Quoted 1 line
Signed-off-by Matthew Daley <[email protected]>
Signed-off-by Samuel Thibault <[email protected]>
Quoted 20 lines
--- stubdom/grub/mini-os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)stubdom/grub/mini-os.c +1
-1@@ -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 );Signature · 1 line
1.9.0
Signature · 3 lines
Samuel <D> N: j'aime bien Cut d'un truc enorme... ca montre de quel cote de l'ecran sont les couilles :))) -+- #ens-mim et la peufeupeu -+-