diff options
author | Timo Teräs <timo.teras@iki.fi> | 2015-10-26 09:40:31 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-27 21:32:00 +0100 |
commit | 82c2fad26c4134cc60eed9a3f05a9bbec70ab65b (patch) | |
tree | 9d1045c5625cd2d86080ffbd4e03c35cacd863d8 | |
parent | cddc98eab7d770427941db4abae2da4ae68f1e68 (diff) | |
download | busybox-w32-82c2fad26c4134cc60eed9a3f05a9bbec70ab65b.tar.gz busybox-w32-82c2fad26c4134cc60eed9a3f05a9bbec70ab65b.tar.bz2 busybox-w32-82c2fad26c4134cc60eed9a3f05a9bbec70ab65b.zip |
fbsplash: use virtual y size in mmap size calculations
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>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | miscutils/fbsplash.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c index 77033c258..9557c41db 100644 --- a/miscutils/fbsplash.c +++ b/miscutils/fbsplash.c | |||
@@ -150,7 +150,7 @@ static void fb_open(const char *strfb_device) | |||
150 | 150 | ||
151 | // map the device in memory | 151 | // map the device in memory |
152 | G.addr = mmap(NULL, | 152 | G.addr = mmap(NULL, |
153 | G.scr_var.yres * G.scr_fix.line_length, | 153 | (G.scr_var.yres_virtual ?: G.scr_var.yres) * G.scr_fix.line_length, |
154 | PROT_WRITE, MAP_SHARED, fbfd, 0); | 154 | PROT_WRITE, MAP_SHARED, fbfd, 0); |
155 | if (G.addr == MAP_FAILED) | 155 | if (G.addr == MAP_FAILED) |
156 | bb_perror_msg_and_die("mmap"); | 156 | bb_perror_msg_and_die("mmap"); |