From 2a97a4b3746aaa588bd78e9fd94dec505e155e11 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 27 Jan 2022 16:29:20 +0900 Subject: [PATCH] test: initialize buffer to make Coverity silent Follow-up for f82f0b993740f4a9a3719c4df7c185411710df2b. Fixes CID#1469119. --- src/test/test-copy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/test-copy.c b/src/test/test-copy.c index 6c7b8d220bc..2c17c9d83da 100644 --- a/src/test/test-copy.c +++ b/src/test/test-copy.c @@ -329,6 +329,7 @@ TEST_RET(copy_holes) { struct stat stat; off_t blksz; int r, fd, fd_copy; + char *buf; fd = mkostemp_safe(fn); assert_se(fd >= 0); @@ -343,7 +344,7 @@ TEST_RET(copy_holes) { assert_se(fstat(fd, &stat) >= 0); blksz = stat.st_blksize; - char buf[blksz]; + buf = alloca0(blksz); /* We need to make sure to create hole in multiples of the block size, otherwise filesystems (btrfs) * might silently truncate/extend the holes. */ -- 2.47.3