Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Sep 18

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 6bc57a931f04fa3f50348d8c8f087187f050c6e1:

eta: remove now unused done_secs (2026-09-11 14:41:56 -0400)

are available in the Git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 162e8fb3d059c090caa56255e4a6a92bfa6e47b3:

client: don't send uninitialized data in fio_send_file error replies (2026-09-17 14:57:34 -0600)

----------------------------------------------------------------
Eric Sandeen (1):
client: don't send uninitialized data in fio_send_file error replies

 client.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

---

Diff of recent changes:

client.c +5 -5
index 374a744a..c1d80783 100644
@@ -1807,7 +1807,7 @@ static int fio_send_file(struct fio_client *client, struct cmd_sendfile *pdu,
 	int fd;
 
 	size = sizeof(*rep);
-	rep = malloc(size);
+	rep = calloc(1, size);
 
 	if (stat((char *)pdu->path, &sb) < 0) {
 fail:
@@ -1817,14 +1817,14 @@ fail:
 		return 1;
 	}
 
-	size += sb.st_size;
-	rep = realloc(rep, size);
-	rep->size = cpu_to_le32((uint32_t) sb.st_size);
-
 	fd = open((char *)pdu->path, O_RDONLY);
 	if (fd == -1 )
 		goto fail;
 
+	size += sb.st_size;
+	rep = realloc(rep, size);
+	rep->size = cpu_to_le32((uint32_t) sb.st_size);
+
 	rep->error = read_data(fd, &rep->data, sb.st_size);
 	sendfile_reply(client->fd, rep, size, tag);
 	free(rep);