1
0
Fork 0
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:
Frank Gevaerts 2010-05-07 19:36:51 +00:00
parent 1c9cc6846c
commit e4f1bfe1c4

View file

@ -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)