diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-05-13 10:35:32 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-05-13 10:35:32 +0000 |
| commit | 263068c6cd59adbe36e79195e5b7b313433271f3 (patch) | |
| tree | 161e7c48b44589b7ab38d84205c0e7e8fe4e1596 | |
| parent | 2b1e168453dcab06f643de3377eff5dd9f135515 (diff) | |
| download | rockbox-263068c6cd59adbe36e79195e5b7b313433271f3.zip rockbox-263068c6cd59adbe36e79195e5b7b313433271f3.tar.gz rockbox-263068c6cd59adbe36e79195e5b7b313433271f3.tar.bz2 rockbox-263068c6cd59adbe36e79195e5b7b313433271f3.tar.xz | |
File rename wrongly accepted an empty target filename, corrupting the file system
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6468 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/onplay.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index f761014..78562c5 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -355,7 +355,7 @@ static bool rename_file(void) int pathlen = (ptr - selected_file); strncpy(newname, selected_file, sizeof newname); if (!kbd_input(newname + pathlen, (sizeof newname)-pathlen)) { - if (!strlen(selected_file+pathlen) || + if (!strlen(newname + pathlen) || (rename(selected_file, newname) < 0)) { lcd_clear_display(); lcd_puts(0,0,str(LANG_RENAME)); |