client: remember to zero pad filename
authorJens Axboe <axboe@fb.com>
Wed, 8 Oct 2014 04:02:21 +0000 (22:02 -0600)
committerJens Axboe <axboe@fb.com>
Wed, 8 Oct 2014 04:02:21 +0000 (22:02 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
client.c

index 5725fd12d87c38b8bef91daafe1afaf96265753d..66f982c0f5010525dfb5dfcfb19fe82c7552e17d 100644 (file)
--- a/client.c
+++ b/client.c
@@ -620,8 +620,9 @@ static int __fio_client_send_remote_ini(struct fio_client *client,
 
        dprint(FD_NET, "send remote ini %s to %s\n", filename, client->hostname);
 
-       p_size = sizeof(*pdu) + strlen(filename);
+       p_size = sizeof(*pdu) + strlen(filename) + 1;
        pdu = malloc(p_size);
+       memset(pdu, 0, p_size);
        pdu->name_len = strlen(filename);
        strcpy((char *) pdu->file, filename);
        pdu->client_type = cpu_to_le16((uint16_t) client->type);