erofs-utils: lib: fix two integer handling issues
PATCH 1/1 erofs-utils: lib: fix two integer handling issues
Coverity-id: 554931
Coverity-id: 555116
Signed-off-by Gao Xiang <[email protected]>
--- lib/super.c | 5 +++++ lib/vmdk.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)
lib/super.c +5 -0
@@ -327,6 +327,11 @@ int erofs_write_device_table(struct erofs_sb_info *sbi)return -EINVAL ; pos =erofs_btell (bh, false); +if (pos ==NULL_ADDR_UL ) { +DBG_BUGON (1 ); +return -EINVAL ; + } + i =0 ; do { struct erofs_deviceslot dis = {
lib/vmdk.c +1 -1
@@ -60,7 +60,7 @@ int erofs_dump_vmdk_desc(FILE *f, struct erofs_sb_info *sbi)const char *name = sbi->devs[i].src_path ?: (const char *)sbi->devs[i].tag; - sectors = sbi->devs[i].blocks << (sbi->blkszbits -9 ); + sectors = (u64 )sbi->devs[i].blocks << (sbi->blkszbits -9 ); ret =erofs_vmdk_desc_add_extent (f, sectors, name,0 );if (ret)return ret;
Signature · 1 line
2.43.5