vapier      14/10/16 17:47:37

  Added:                util-linux-2.25.1-blkid-probe-fix.patch
  Log:
  Add fix from upstream for libblkid probing.
  
  (Portage version: 2.2.14_rc1/cvs/Linux x86_64, signed Manifest commit with 
key D2E96200)

Revision  Changes    Path
1.1                  
sys-apps/util-linux/files/util-linux-2.25.1-blkid-probe-fix.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/util-linux/files/util-linux-2.25.1-blkid-probe-fix.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/util-linux/files/util-linux-2.25.1-blkid-probe-fix.patch?rev=1.1&content-type=text/plain

Index: util-linux-2.25.1-blkid-probe-fix.patch
===================================================================
>From 00749bc366fe6106df918660a92a388cfff4f35f Mon Sep 17 00:00:00 2001
From: Karel Zak <[email protected]>
Date: Tue, 7 Oct 2014 12:44:34 +0200
Subject: [PATCH] libblkid: zeroize errno on blkid_probe_get_buffer() success

Since 37f4060225df0591ab8e1dd676dbc8115d900d4f prober functions are
sensitive to errno, it seems more robust to set errno=0 with in
blkid_probe_get_buffer() on success than set the zero on all places
where we call blkid_probe_get_buffer().

Addresses: https://github.com/karelzak/util-linux/issues/119
Signed-off-by: Karel Zak <[email protected]>
---
 libblkid/src/probe.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
index 4fea3cc..3f7e43b 100644
--- a/libblkid/src/probe.c
+++ b/libblkid/src/probe.c
@@ -539,8 +539,10 @@ unsigned char *blkid_probe_get_buffer(blkid_probe pr,
        struct list_head *p;
        struct blkid_bufinfo *bf = NULL;
 
-       if (pr->size <= 0)
+       if (pr->size <= 0) {
+               errno = EINVAL;
                return NULL;
+       }
 
        if (pr->parent &&
            pr->parent->devno == pr->devno &&
@@ -602,6 +604,7 @@ unsigned char *blkid_probe_get_buffer(blkid_probe pr,
                list_add_tail(&bf->bufs, &pr->buffers);
        }
 
+       errno = 0;
        return off ? bf->data + (off - bf->off) : bf->data;
 }
 
-- 
2.1.2





Reply via email to