[PATCH] erofs-utils: lib: fix NULL dereference
Gao Xiang
hsiangkao at linux.alibaba.com
Wed Jun 18 19:38:52 AEST 2025
Coverity-id: 555136
Fixes: 84bae6acdbee ("erofs-utils: lib: keep full data until the fragment is committed")
Signed-off-by: Gao Xiang <hsiangkao at linux.alibaba.com>
---
lib/fragments.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/fragments.c b/lib/fragments.c
index d63995e..0784a82 100644
--- a/lib/fragments.c
+++ b/lib/fragments.c
@@ -311,7 +311,7 @@ int erofs_pack_file_from_fd(struct erofs_inode *inode, int fd, u32 tofh)
out:
if (onheap)
free(memblock);
- else
+ else if (memblock)
munmap(memblock, inode->i_size);
return rc;
}
--
2.43.5
More information about the Linux-erofs
mailing list