From: Yu Watanabe Date: Thu, 27 Jan 2022 07:29:20 +0000 (+0900) Subject: test: initialize buffer to make Coverity silent X-Git-Tag: v251-rc1~445 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2a97a4b3746aaa588bd78e9fd94dec505e155e11;p=thirdparty%2Fsystemd.git test: initialize buffer to make Coverity silent Follow-up for f82f0b993740f4a9a3719c4df7c185411710df2b. Fixes CID#1469119. --- 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. */