summaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorTomohiro Kusumi <tkusumi@tuxera.com>2017-09-18 20:53:50 +0300
committerJens Axboe <axboe@kernel.dk>2017-09-18 12:04:38 -0600
commit13a85be93769986e03662e8dae6f8bfdf2971aa9 (patch)
tree89409b8c9fe96abb9fd69b15575a95d41b0bf693 /server.c
parentba8b89a1549c5ce7d7544813c9137798de454fac (diff)
downloadfio-13a85be93769986e03662e8dae6f8bfdf2971aa9.tar.gz
fio-13a85be93769986e03662e8dae6f8bfdf2971aa9.tar.bz2
fix strncpy(3) copy length
0 terminate the last byte, and copy at most size-1. (or 0 terminate the last byte after copying upto size bytes) Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'server.c')
-rw-r--r--server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/server.c b/server.c
index 0469cea7..e6ea4cdb 100644
--- a/server.c
+++ b/server.c
@@ -856,7 +856,7 @@ static int handle_probe_cmd(struct fio_net_cmd *cmd)
#ifdef CONFIG_BIG_ENDIAN
probe.bigendian = 1;
#endif
- strncpy((char *) probe.fio_version, fio_version_string, sizeof(probe.fio_version));
+ strncpy((char *) probe.fio_version, fio_version_string, sizeof(probe.fio_version) - 1);
probe.os = FIO_OS;
probe.arch = FIO_ARCH;