projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
file: fix potential buffer overrun in get_fs_free_counts()
[fio.git]
/
filesetup.c
diff --git
a/filesetup.c
b/filesetup.c
index bf56112b72b9784cf32583ebc0dbba72324b9f86..c132c326e33afe5766cb2fbe15e1d031b8a30fa3 100644
(file)
--- a/
filesetup.c
+++ b/
filesetup.c
@@
-688,7
+688,8
@@
static unsigned long long get_fs_free_counts(struct thread_data *td)
} else if (f->filetype != FIO_TYPE_FILE)
continue;
- strcpy(buf, f->file_name);
+ buf[255] = '\0';
+ strncpy(buf, f->file_name, 255);
if (stat(buf, &sb) < 0) {
if (errno != ENOENT)