Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
filebundle: coverity - fix possible buf overflow in fb_readdir()
  • Loading branch information
perexg committed Oct 3, 2014
1 parent 152dc61 commit 1cb1f67
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/filebundle.c
Expand Up @@ -280,7 +280,8 @@ fb_dirent *fb_readdir ( fb_dir *dir )
fb_dirent *ret = NULL;
if (dir->type == FB_BUNDLE) {
if (dir->b.cur) {
strcpy(dir->dirent.name, dir->b.cur->name);
strncpy(dir->dirent.name, dir->b.cur->name, sizeof(dir->dirent.name)-1);
dir->dirent.name[sizeof(dir->dirent.name)-1] = '\0';
dir->dirent.type = dir->b.cur->type;
dir->b.cur = dir->b.cur->next;
ret = &dir->dirent;
Expand Down

0 comments on commit 1cb1f67

Please sign in to comment.