Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP4:GA
exfatprogs
0004-fsck-fix-return-value-of-read_boot_region....
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0004-fsck-fix-return-value-of-read_boot_region.patch of Package exfatprogs
From c6fb0a216ac322cc7ee1bb08d33577ef09df5a63 Mon Sep 17 00:00:00 2001 From: Hyunchul Lee <hyc.lee@gmail.com> Date: Thu, 27 Aug 2020 16:47:03 +0900 Subject: [PATCH 4/9] fsck: fix return value of read_boot_region even if boot sector is invalid, read_boot_region could return valid value. Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com> (cherry picked from commit 4c43c7488c5deebf06756aa09771d4dde0bef72b) Acked-by: David Disseldorp <ddiss@suse.de> --- fsck/fsck.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 3618b0d..39c193d 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -672,8 +672,8 @@ static int read_boot_region(struct exfat_blk_dev *bd, struct pbr **pbr, if (exfat_read(bd->dev_fd, bs, sizeof(*bs), bs_offset * bd->sector_size) != (ssize_t)sizeof(*bs)) { exfat_err("failed to read a boot sector\n"); - free(bs); - return -EIO; + ret = -EIO; + goto err; } if (memcmp(bs->bpb.oem_name, "EXFAT ", 8) != 0) { @@ -685,6 +685,7 @@ static int read_boot_region(struct exfat_blk_dev *bd, struct pbr **pbr, if (ret < 0) goto err; + ret = -EINVAL; if (EXFAT_SECTOR_SIZE(bs) < 512 || EXFAT_SECTOR_SIZE(bs) > 4 * KB) { exfat_err("too small or big sector size: %d\n", EXFAT_SECTOR_SIZE(bs)); -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor