X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=client.c;h=82db502028d9f5b488ca31750299946d3f30440e;hp=410ffb891d4a487515ed396161892d02b7653aad;hb=d9644df9f41ce6d16c50298dff04ede5ce110b63;hpb=2ed0bd1cefe817d44e2f735e2cea41f6253f571d diff --git a/client.c b/client.c index 410ffb89..82db5020 100644 --- a/client.c +++ b/client.c @@ -1302,12 +1302,15 @@ static int fio_client_handle_iolog(struct fio_client *client, return 1; } - /* generate a unique pathname for the log file using hostname */ - log_pathname = malloc(PATH_MAX+10); + /* allocate buffer big enough for next sprintf() call */ + log_pathname = malloc( 10 + + strlen((char * )pdu->name) + + strlen(client->hostname)); if (!log_pathname) { log_err("fio: memory allocation of unique pathname failed"); return -1; } + /* generate a unique pathname for the log file using hostname */ sprintf(log_pathname, "%s.%s", pdu->name, client->hostname); if (store_direct) {