summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2015-02-25 23:10:35 +0100
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2015-02-25 23:32:50 +0100
commit3a4efbff2e729194d286f483bd8e122c52ff1129 (patch)
treee3756a527f49abfadfd81c80dc2a760f78999322
parent5bd4b173605142c7be493aa4d958ebaef21f421d (diff)
bootctl: check that partition uuid is valid
It probably is but check anyway to make coverity happy. CID#1271354
-rw-r--r--src/boot/bootctl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c
index fb568bebbe..bd55fa95b0 100644
--- a/src/boot/bootctl.c
+++ b/src/boot/bootctl.c
@@ -177,7 +177,13 @@ static int verify_esp(const char *p, uint32_t *part, uint64_t *pstart, uint64_t
fprintf(stderr, "Failed to probe partition entry UUID %s: %s\n", p, strerror(-r));
goto fail;
}
- sd_id128_from_string(v, uuid);
+
+ r = sd_id128_from_string(v, uuid);
+ if (r < 0) {
+ fprintf(stderr, "Partition %s has invalid UUID: %s\n", p, v);
+ r = -EIO;
+ goto fail;
+ }
errno = 0;
r = blkid_probe_lookup_value(b, "PART_ENTRY_NUMBER", &v, NULL);