filebundle: fix possible buf overflow in fb_scandir() - coverity
This commit is contained in:
parent
a0e4c0133c
commit
60aeeac40d
1 changed files with 2 additions and 1 deletions
|
@ -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++;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue