summaryrefslogtreecommitdiffstats
path: root/apps/tree.c
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-07-23 10:31:56 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2021-07-24 13:44:35 +0000
commit42ba117952fcb4e486aa7a0e27add800a8649e31 (patch)
treece992379566e974793efda07d605deef7bf26beb /apps/tree.c
parent26fd90bb49a5191dc7f4c853e1ec8aa334b5a5c7 (diff)
downloadrockbox-42ba117952fcb4e486aa7a0e27add800a8649e31.tar.gz
rockbox-42ba117952fcb4e486aa7a0e27add800a8649e31.zip
tree.c use strlcpy to avoid buffer ovfl
Change-Id: I6ac4ec6306c2101b11bc0495edd7bbe2717acf9c
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 88ccff5e37..1f7102dbb9 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -372,7 +372,7 @@ static int update_dir(void)
{
if (ft_load(&tc, NULL) < 0)
return -1;
- strcpy(lastdir, tc.currdir);
+ strlcpy(lastdir, tc.currdir, MAX_PATH);
changed = true;
}
}
@@ -568,7 +568,7 @@ void set_current_file(const char *path)
name = path+1;
}
- strcpy(lastfile, name);
+ strlcpy(lastfile, name, MAX_PATH);
/* If we changed dir we must recalculate the dirlevel
@@ -987,7 +987,7 @@ int rockbox_browse(struct browse_context *browse)
if (dirfilter != SHOW_ID3DB)
tc.dirfilter = &global_settings.dirfilter;
tc.browse = browse;
- strcpy(current, browse->root);
+ strlcpy(current, browse->root, MAX_PATH);
set_current_file(current);
if (browse->flags&BROWSE_RUNFILE)
ret_val = ft_enter(&tc);