mirror of
https://github.com/systemd/systemd
synced 2024-09-06 00:41:36 +00:00
test: initialize buffer to make Coverity silent
Follow-up for f82f0b9937
.
Fixes CID#1469119.
This commit is contained in:
parent
7e7a9f9c8b
commit
2a97a4b374
|
@ -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. */
|
||||
|
|
Loading…
Reference in a new issue