Not an issue right now since pdu.server is larger than the buffer,
but that could change at some point. Better be safe.
Signed-off-by: Jens Axboe <axboe@fb.com>
static void probe_client(struct fio_client *client)
{
struct cmd_client_probe_pdu pdu;
static void probe_client(struct fio_client *client)
{
struct cmd_client_probe_pdu pdu;
uint64_t tag;
char buf[64];
uint64_t tag;
char buf[64];
- strcpy((char *) pdu.server, server_name(client, buf, sizeof(buf)));
+ sname = server_name(client, buf, sizeof(buf));
+ memset(pdu.server, 0, sizeof(pdu.server));
+ strncpy((char *) pdu.server, sname, sizeof(pdu.server) - 1);
fio_net_send_cmd(client->fd, FIO_NET_CMD_PROBE, &pdu, sizeof(pdu), &tag, &client->cmd_list);
}
fio_net_send_cmd(client->fd, FIO_NET_CMD_PROBE, &pdu, sizeof(pdu), &tag, &client->cmd_list);
}