forked from len0rd/rockbox
Added bad filename protection when user enters an fm radio preset filename. Fixes bugreport 5137.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9795 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
45406014d7
commit
ab90b1d55e
3 changed files with 54 additions and 5 deletions
|
|
@ -1316,10 +1316,11 @@ void set_file(char* filename, char* setting, int maxlen)
|
|||
|
||||
len = strlen(fptr);
|
||||
ptr = fptr + len;
|
||||
while (*ptr != '.') {
|
||||
while ((*ptr != '.') && (ptr != fptr)) {
|
||||
extlen++;
|
||||
ptr--;
|
||||
}
|
||||
if(ptr == fptr) extlen = 0;
|
||||
|
||||
if (strncasecmp(ROCKBOX_DIR, filename ,strlen(ROCKBOX_DIR)) ||
|
||||
(len-extlen > maxlen))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue