summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-08-04 20:22:37 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-08-06 15:46:53 +0000
commit34fcea0b20d58dbf0fd091a864db4ee8aa5d554c (patch)
tree319bdc76e106de101dbb4b8891cd65e2d58eea5d
parent835d0c737a7e04f30b3990249ce461999ea2cf3a (diff)
downloadrockbox-34fcea0b20d58dbf0fd091a864db4ee8aa5d554c.tar.gz
rockbox-34fcea0b20d58dbf0fd091a864db4ee8aa5d554c.tar.bz2
rockbox-34fcea0b20d58dbf0fd091a864db4ee8aa5d554c.zip
Fix path buffer overflow in screendump
Overflow is due to a hidden assumption in create_datetime_filename() and create_numbered_filename() where buffer must be >= MAX_PATH bytes. Change-Id: I9d36517d861b6925352380d551afc5439edbb340
-rw-r--r--firmware/screendump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/screendump.c b/firmware/screendump.c
index 1acaaafba6..7d09b0cd5e 100644
--- a/firmware/screendump.c
+++ b/firmware/screendump.c
@@ -102,7 +102,7 @@ static void (*screen_dump_hook)(int fh) = NULL;
void screen_dump(void)
{
int fd, y;
- char filename[32];
+ char filename[MAX_PATH];
fb_data *src;
#if LCD_DEPTH == 1
@@ -306,7 +306,7 @@ static const unsigned char rbmpheader[] =
void remote_screen_dump(void)
{
int fd, y;
- char filename[32];
+ char filename[MAX_PATH];
fb_remote_data *src;
#if LCD_REMOTE_DEPTH == 1