1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-20 01:58:18 +03:00

test: initialize buffer to make Coverity silent

Follow-up for f82f0b993740f4a9a3719c4df7c185411710df2b.

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