[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: [PATCH] fbsplash: use virtual y size in mmap size calculations
From: Timo Teräs <timo.teras () iki ! fi>
Date: 2015-07-22 12:17:54
Message-ID: 1437567474-2586-1-git-send-email-timo.teras () iki ! fi
[Download RAW message or body]
The virtual y can be larger - and we can be even writing there since
we are taking into account the y offset. Avoids possible crash.
But use it only if set, seems it is not set if virtual area is not
allocated (though, often fbcon allocates some scrollback area).
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
---
miscutils/fbsplash.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c
index 7b695b2..e05ab3b 100644
--- a/miscutils/fbsplash.c
+++ b/miscutils/fbsplash.c
@@ -150,7 +150,7 @@ static void fb_open(const char *strfb_device)
// map the device in memory
G.addr = mmap(NULL,
- G.scr_var.yres * G.scr_fix.line_length,
+ (G.scr_var.yres_virtual ?: G.scr_var.yres) * G.scr_fix.line_length,
PROT_WRITE, MAP_SHARED, fbfd, 0);
if (G.addr == MAP_FAILED)
bb_perror_msg_and_die("mmap");
--
2.2.0
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic