From: Karel Zak Date: Wed, 17 Jan 2024 08:43:05 +0000 (+0100) Subject: Merge branch 'libblkid/drbd/padding' of https://github.com/t-8ch/util-linux X-Git-Tag: v2.40-rc1~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf6dbd34534c9233d6eb4607003a4fd1f1db94e7;p=thirdparty%2Futil-linux.git Merge branch 'libblkid/drbd/padding' of https://github.com/t-8ch/util-linux * 'libblkid/drbd/padding' of https://github.com/t-8ch/util-linux: libblkid: (drbd) validate zero padding libblkid: avoid aligning out of probing area --- bf6dbd34534c9233d6eb4607003a4fd1f1db94e7 diff --cc libblkid/src/superblocks/drbd.c index 7f72eb13f3,b425906927..811098a5d2 --- a/libblkid/src/superblocks/drbd.c +++ b/libblkid/src/superblocks/drbd.c @@@ -124,9 -122,19 +122,19 @@@ struct meta_data_on_disk_9 } __attribute__((packed)); + static int is_zero_padded(const unsigned char *padding_start, + const unsigned char *padding_end) + { + for (; padding_start < padding_end; padding_start++) { + if (*padding_start != 0) + return 0; + } + return 1; + } + static int probe_drbd_84(blkid_probe pr, const struct blkid_idmag *mag) { - struct md_on_disk_08 *md; + const struct md_on_disk_08 *md; md = blkid_probe_get_sb(pr, mag, struct md_on_disk_08); if (!md)