summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-07-15 09:26:01 -0600
committerJens Axboe <axboe@kernel.dk>2021-07-15 09:26:01 -0600
commitaaedde68bfb2d15c3a444df496ba26ac0956445c (patch)
tree399db5a85f18316446175a2b0b5eed9d9ac66772
parent7a9cc9c93c1384f72ac16d1d7980e158ec5f9f0a (diff)
parentfb2bec152eb5c98313329c38bb6baf59648f609b (diff)
downloadfio-aaedde68bfb2d15c3a444df496ba26ac0956445c.tar.gz
fio-aaedde68bfb2d15c3a444df496ba26ac0956445c.tar.bz2
Merge branch 'cmd-test-be' of https://github.com/tuan-hoang1/fio
* 'cmd-test-be' of https://github.com/tuan-hoang1/fio: server: fix missing le32_to_cpu conversion when opcode is FIO_NET_CMD_TEXT
-rw-r--r--server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/server.c b/server.c
index 8daefbab..42eaa4b1 100644
--- a/server.c
+++ b/server.c
@@ -409,8 +409,9 @@ struct fio_net_cmd *fio_net_recv_cmd(int sk, bool wait)
if (cmdret->opcode == FIO_NET_CMD_TEXT) {
struct cmd_text_pdu *__pdu = (struct cmd_text_pdu *) cmdret->payload;
char *buf = (char *) __pdu->buf;
+ int len = le32_to_cpu(__pdu->buf_len);
- buf[__pdu->buf_len] = '\0';
+ buf[len] = '\0';
} else if (cmdret->opcode == FIO_NET_CMD_JOB) {
struct cmd_job_pdu *__pdu = (struct cmd_job_pdu *) cmdret->payload;
char *buf = (char *) __pdu->buf;