Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
filebundle: fix possible buf overflow in fb_scandir() - coverity
  • Loading branch information
perexg committed Oct 3, 2014
1 parent a0e4c01 commit 60aeeac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/filebundle.c
Expand Up @@ -349,7 +349,8 @@ int fb_scandir ( const char *path, fb_dirent ***list )
i = 0;
while (fb) {
(*list)[i] = calloc(1, sizeof(fb_dirent));
strcpy((*list)[i]->name, fb->name);
strncpy((*list)[i]->name, fb->name, sizeof((*list)[i]->name));
(*list)[i]->name[sizeof((*list)[i]->name)-1] = '\0';
fb = fb->next;
i++;
}
Expand Down

0 comments on commit 60aeeac

Please sign in to comment.