commit | da27a4bf0f9753fcc9da7b63f1be482fc0349907 | [log] [tgz] |
---|---|---|
author | Jens Axboe <axboe@fb.com> | Mon Apr 14 08:45:13 2014 -0600 |
committer | Jens Axboe <axboe@fb.com> | Mon Apr 14 08:45:13 2014 -0600 |
tree | 34c87f91c0b6e358dc3cde22bf893ccc9ed6de4d | |
parent | dacbbb8875c09e982d59e1c1a40879af81842a42 [diff] |
file: fix potential buffer overrun in get_fs_free_counts() Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/filesetup.c b/filesetup.c index bf56112..c132c32 100644 --- a/filesetup.c +++ b/filesetup.c
@@ -688,7 +688,8 @@ } 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)