summaryrefslogtreecommitdiffstats
path: root/shlibs/blkid/src/superblocks/udf.c
diff options
context:
space:
mode:
authorKarel Zak2011-03-16 14:06:23 +0100
committerKarel Zak2011-03-16 14:06:23 +0100
commit7e256156f4a8650f0e5c5aaea9cf93d9bf3e1294 (patch)
treef84f8602ea53a834912f8a13607f4edb7d68a79e /shlibs/blkid/src/superblocks/udf.c
parentRevert "umount: call /sbin/umount.<uhelper> for root user too" (diff)
downloadkernel-qcow2-util-linux-7e256156f4a8650f0e5c5aaea9cf93d9bf3e1294.tar.gz
kernel-qcow2-util-linux-7e256156f4a8650f0e5c5aaea9cf93d9bf3e1294.tar.xz
kernel-qcow2-util-linux-7e256156f4a8650f0e5c5aaea9cf93d9bf3e1294.zip
libblkid: use blkid_probe_get_buffer() more carefully
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/blkid/src/superblocks/udf.c')
-rw-r--r--shlibs/blkid/src/superblocks/udf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/shlibs/blkid/src/superblocks/udf.c b/shlibs/blkid/src/superblocks/udf.c
index 78ddda684..766d6980f 100644
--- a/shlibs/blkid/src/superblocks/udf.c
+++ b/shlibs/blkid/src/superblocks/udf.c
@@ -55,7 +55,7 @@ struct volume_structure_descriptor {
uint8_t version;
} __attribute__((packed));
-#define UDF_VSD_OFFSET 0x8000
+#define UDF_VSD_OFFSET 0x8000LL
static int probe_udf(blkid_probe pr, const struct blkid_idmag *mag)
{
@@ -86,7 +86,7 @@ nsr:
for (b = 0; b < 64; b++) {
vsd = (struct volume_structure_descriptor *)
blkid_probe_get_buffer(pr,
- UDF_VSD_OFFSET + (b * bs),
+ UDF_VSD_OFFSET + ((blkid_loff_t) b * bs),
sizeof(*vsd));
if (!vsd)
return -1;
@@ -117,7 +117,9 @@ anchor:
/* pick the primary descriptor from the list */
for (b = 0; b < count; b++) {
vd = (struct volume_descriptor *)
- blkid_probe_get_buffer(pr, (loc + b) * bs, sizeof(*vd));
+ blkid_probe_get_buffer(pr,
+ (blkid_loff_t) (loc + b) * bs,
+ sizeof(*vd));
if (!vd)
return -1;