forked from len0rd/rockbox
Fix possible buffer overflow
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25886 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
1c9cc6846c
commit
e4f1bfe1c4
1 changed files with 4 additions and 4 deletions
|
@ -128,7 +128,7 @@ static void get_pic_list(void)
|
|||
pname = rb->strrchr(np_file,'/');
|
||||
pname++;
|
||||
|
||||
for (i = 0; i < tree->filesindir; i++)
|
||||
for (i = 0; i < tree->filesindir && buf_size > sizeof(char**); i++)
|
||||
{
|
||||
if (!(dircache[i].attr & ATTR_DIRECTORY)
|
||||
&& img_ext(rb->strrchr(dircache[i].name,'.')))
|
||||
|
@ -138,11 +138,11 @@ static void get_pic_list(void)
|
|||
if (!rb->strcmp(file_pt[entries], pname))
|
||||
curfile = entries;
|
||||
entries++;
|
||||
|
||||
buf += (sizeof(char**));
|
||||
buf_size -= (sizeof(char**));
|
||||
}
|
||||
}
|
||||
|
||||
buf += (entries * sizeof(char**));
|
||||
buf_size -= (entries * sizeof(char**));
|
||||
}
|
||||
|
||||
static int change_filename(int direct)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue