projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dacbbb8
)
file: fix potential buffer overrun in get_fs_free_counts()
author
Jens Axboe
<axboe@fb.com>
Mon, 14 Apr 2014 14:45:13 +0000
(08:45 -0600)
committer
Jens Axboe
<axboe@fb.com>
Mon, 14 Apr 2014 14:45:13 +0000
(08:45 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
filesetup.c
patch
|
blob
|
blame
|
history
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)