summaryrefslogtreecommitdiffstats
path: root/libs/blkid/src/probe.c
diff options
context:
space:
mode:
authorKarel Zak2009-04-29 16:38:36 +0200
committerKarel Zak2009-04-29 16:38:36 +0200
commit4884729a6e5c2dbd0c7cdf356a86543525e43661 (patch)
tree7d8d7efb883cad848160ab391e4ef6bf2af82b02 /libs/blkid/src/probe.c
parenttests: fix -regex in run.sh (diff)
downloadkernel-qcow2-util-linux-4884729a6e5c2dbd0c7cdf356a86543525e43661.tar.gz
kernel-qcow2-util-linux-4884729a6e5c2dbd0c7cdf356a86543525e43661.tar.xz
kernel-qcow2-util-linux-4884729a6e5c2dbd0c7cdf356a86543525e43661.zip
blkid: linux_raid - fix logic for volumes with size == 0
Based on commit 7643819062985d9fc6c7664072576e71d3822b10 Author: Kay Sievers <kay.sievers@vrfy.org> Date: Sat Sep 6 16:23:21 2008 +0200 from udev upstream tree. Reported-by: Scott James Remnant <scott@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libs/blkid/src/probe.c')
-rw-r--r--libs/blkid/src/probe.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/blkid/src/probe.c b/libs/blkid/src/probe.c
index e6038c206..0e4745aca 100644
--- a/libs/blkid/src/probe.c
+++ b/libs/blkid/src/probe.c
@@ -196,6 +196,11 @@ unsigned char *blkid_probe_get_buffer(blkid_probe pr,
{
ssize_t ret_read = 0;
+ if (off < 0 || len < 0) {
+ DBG(DEBUG_LOWPROBE,
+ printf("unexpected offset or length of buffer requested\n"));
+ return NULL;
+ }
if (off + len <= BLKID_SB_BUFSIZ) {
if (!pr->sbbuf) {
pr->sbbuf = malloc(BLKID_SB_BUFSIZ);