summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2018-12-06 22:56:39 -0600
committerWilliam Wilgus <me.theuser@yahoo.com>2019-07-10 06:52:43 +0200
commitcf6584a483786992eb919b93eed0653f28208f9e (patch)
tree5dd6ada383d95f5029b7be97e730c5c0b13b573c /apps
parent3ec002e12160957265e5980cbd54a028ba19319b (diff)
Fix possible truncation playlist_catalog.c->catalog_add_to_a_playlist
Change-Id: Ib142b07916ccca044674e5cabec379316c07e9d9
Diffstat (limited to 'apps')
-rw-r--r--apps/playlist_catalog.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/playlist_catalog.c b/apps/playlist_catalog.c
index 5741d11258..3d524998b2 100644
--- a/apps/playlist_catalog.c
+++ b/apps/playlist_catalog.c
@@ -322,7 +322,7 @@ bool catalog_add_to_a_playlist(const char* sel, int sel_attr,
bool new_playlist, char *m3u8name)
{
int result;
- char playlist[MAX_PATH];
+ char playlist[MAX_PATH + 6];
if (in_add_to_playlist)
return false;
@@ -336,7 +336,7 @@ bool catalog_add_to_a_playlist(const char* sel, int sel_attr,
{
/*If sel is a folder, we prefill the text field with its name*/
const char *name = strrchr(sel, '/');
- snprintf(playlist, MAX_PATH, "%s/%s.m3u8",
+ snprintf(playlist, sizeof(playlist), "%s/%s.m3u8",
playlist_dir,
(name!=NULL && (sel_attr & ATTR_DIRECTORY))?name+1:"");
}
@@ -350,7 +350,7 @@ bool catalog_add_to_a_playlist(const char* sel, int sel_attr,
else if(len <= 5 || strcasecmp(&playlist[len-5], ".m3u8"))
strcat(playlist, ".m3u8");
- if (kbd_input(playlist, MAX_PATH))
+ if (kbd_input(playlist, sizeof(playlist)))
return false;
}
else