From d9c50de7c1d95e5c173ac6d7f5b3f0d63131f8b4 Mon Sep 17 00:00:00 2001 From: Keith Busch Date: Mon, 11 Mar 2019 10:46:47 -0600 Subject: [PATCH] t/io_uring: memset() allocated memory But I totally rushed this patch and just sent it once I heard it "worked", and it really doesn't because malloc doesn't zero the buffer. My mistake, kzalloc spoiled me. Here's the fix: Fixes: e39863e3cb61 ("t/io_uring: add depth options") Signed-off-by: Jens Axboe --- t/io_uring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/io_uring.c b/t/io_uring.c index 36aede9b..363cba3e 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -526,7 +526,8 @@ int main(int argc, char *argv[]) } } - submitter = malloc(sizeof(*submitter) * depth * sizeof(struct iovec)); + submitter = malloc(sizeof(*submitter) + depth * sizeof(struct iovec)); + memset(submitter, 0, sizeof(*submitter) + depth * sizeof(struct iovec)); s = submitter; flags = O_RDONLY | O_NOATIME; -- 2.25.1