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)
downloadrockbox-cf6584a483786992eb919b93eed0653f28208f9e.tar.gz
rockbox-cf6584a483786992eb919b93eed0653f28208f9e.zip
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,
322 bool new_playlist, char *m3u8name) 322 bool new_playlist, char *m3u8name)
323{ 323{
324 int result; 324 int result;
325 char playlist[MAX_PATH]; 325 char playlist[MAX_PATH + 6];
326 if (in_add_to_playlist) 326 if (in_add_to_playlist)
327 return false; 327 return false;
328 328
@@ -336,7 +336,7 @@ bool catalog_add_to_a_playlist(const char* sel, int sel_attr,
336 { 336 {
337 /*If sel is a folder, we prefill the text field with its name*/ 337 /*If sel is a folder, we prefill the text field with its name*/
338 const char *name = strrchr(sel, '/'); 338 const char *name = strrchr(sel, '/');
339 snprintf(playlist, MAX_PATH, "%s/%s.m3u8", 339 snprintf(playlist, sizeof(playlist), "%s/%s.m3u8",
340 playlist_dir, 340 playlist_dir,
341 (name!=NULL && (sel_attr & ATTR_DIRECTORY))?name+1:""); 341 (name!=NULL && (sel_attr & ATTR_DIRECTORY))?name+1:"");
342 } 342 }
@@ -350,7 +350,7 @@ bool catalog_add_to_a_playlist(const char* sel, int sel_attr,
350 else if(len <= 5 || strcasecmp(&playlist[len-5], ".m3u8")) 350 else if(len <= 5 || strcasecmp(&playlist[len-5], ".m3u8"))
351 strcat(playlist, ".m3u8"); 351 strcat(playlist, ".m3u8");
352 352
353 if (kbd_input(playlist, MAX_PATH)) 353 if (kbd_input(playlist, sizeof(playlist)))
354 return false; 354 return false;
355 } 355 }
356 else 356 else