test: initialize buffer to make Coverity silent

Follow-up for f82f0b9937.

Fixes CID#1469119.
This commit is contained in:
Yu Watanabe 2022-01-27 16:29:20 +09:00 committed by Luca Boccassi
parent 7e7a9f9c8b
commit 2a97a4b374

View file

@ -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. */