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:
dfbf1f6
)
server: ensure that incoming iolog name is NULL terminated
author
Jens Axboe
<axboe@fb.com>
Mon, 14 Apr 2014 17:45:34 +0000
(11:45 -0600)
committer
Jens Axboe
<axboe@fb.com>
Mon, 14 Apr 2014 17:45:34 +0000
(11:45 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
server.c
patch
|
blob
|
blame
|
history
diff --git
a/server.c
b/server.c
index f65f3abfc87339211c72302e0ed7f36243382ed9..077dce5c349f67efec5c76a6371e89e2a2a4724f 100644
(file)
--- a/
server.c
+++ b/
server.c
@@
-1225,7
+1225,9
@@
int fio_send_iolog(struct thread_data *td, struct io_log *log, const char *name)
pdu.nr_samples = __cpu_to_le32(log->nr_samples);
pdu.log_type = cpu_to_le32(log->log_type);
pdu.compressed = cpu_to_le32(use_zlib);
- strcpy((char *) pdu.name, name);
+
+ strncpy((char *) pdu.name, name, FIO_NET_NAME_MAX);
+ pdu.name[FIO_NET_NAME_MAX - 1] = '\0';
for (i = 0; i < log->nr_samples; i++) {
struct io_sample *s = &log->log[i];