projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
f0cc675
)
Fix potentially unterminated string after strncpy() call
author
Jens Axboe
<axboe@fb.com>
Fri, 11 Apr 2014 17:32:49 +0000
(11:32 -0600)
committer
Jens Axboe
<axboe@fb.com>
Fri, 11 Apr 2014 17:32:49 +0000
(11:32 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
diskutil.c
patch
|
blob
|
blame
|
history
diff --git
a/diskutil.c
b/diskutil.c
index 5170915c91d5309eeae539b2cc32e9531c7c16d4..1b4accb31d5c669b6ae09638b60c1d4a840ddad6 100644
(file)
--- a/
diskutil.c
+++ b/
diskutil.c
@@
-297,7
+297,7
@@
static struct disk_util *disk_util_add(struct thread_data *td, int majdev,
sfree(du);
return NULL;
}
- strncpy((char *) du->dus.name, basename(path), FIO_DU_NAME_SZ);
+ strncpy((char *) du->dus.name, basename(path)
- 1
, FIO_DU_NAME_SZ);
du->sysfs_root = path;
du->major = majdev;
du->minor = mindev;