All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] x86, efi: fix pointer math issue in handle_ramdisks()
@ 2012-03-02 19:01 ` Dan Carpenter
  0 siblings, 0 replies; 18+ messages in thread
From: Dan Carpenter @ 2012-03-02 19:01 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Thomas Gleixner, Ingo Molnar, x86, Matt Fleming,
	Maarten Lankhorst, linux-kernel, kernel-janitors

"filename" is a efi_char16_t string so this check for reaching the end
of the array doesn't work.  We need to cast it to char pointer before
doing the math.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index fec216f..cf4cdb7 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -559,7 +559,7 @@ static efi_status_t handle_ramdisks(efi_loaded_image_t *image,
 			str++;
 
 		while (*str && *str != ' ' && *str != '\n') {
-			if (p >= filename + sizeof(filename))
+			if ((char *)p >= (char *)filename + sizeof(filename))
 				break;
 
 			*p++ = *str++;

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-03-18 14:34 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-02 19:01 [patch] x86, efi: fix pointer math issue in handle_ramdisks() Dan Carpenter
2012-03-02 19:01 ` Dan Carpenter
2012-03-03  7:54 ` Ingo Molnar
2012-03-03  7:54   ` Ingo Molnar
2012-03-05 18:06   ` [patch v2] " Dan Carpenter
2012-03-05 18:06     ` Dan Carpenter
2012-03-05 18:42     ` walter harms
2012-03-05 18:42       ` walter harms
2012-03-05 19:33       ` H. Peter Anvin
2012-03-05 19:33         ` H. Peter Anvin
2012-03-06  8:44         ` walter harms
2012-03-06  8:44           ` walter harms
2012-03-16 19:55           ` H. Peter Anvin
2012-03-16 19:55             ` H. Peter Anvin
2012-03-18 14:33             ` walter harms
2012-03-18 14:33               ` walter harms
2012-03-16 15:20     ` Matt Fleming
2012-03-16 21:27     ` [tip:x86/urgent] x86, efi: Fix " tip-bot for Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.