projects
/
platform
/
upstream
/
erofs-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8123399
)
erofs-utils: lib: fix potential memory leak in erofs_export_xattr_ibody()
author
Gao Xiang
<hsiangkao@linux.alibaba.com>
Fri, 2 Aug 2024 06:23:16 +0000
(14:23 +0800)
committer
Gao Xiang
<hsiangkao@linux.alibaba.com>
Sun, 4 Aug 2024 01:51:05 +0000
(09:51 +0800)
Although it won't happen in reality except for bugs.
Fixes: 8f93c2f83962 ("erofs-utils: mkfs: support inline xattr reservation for rootdirs")
Coverity-id: 507395
Reviewed-by: Sandeep Dhavale <dhavale@google.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link:
https://lore.kernel.org/r/20240802062316.2368403-1-hsiangkao@linux.alibaba.com
lib/xattr.c
patch
|
blob
|
history
diff --git
a/lib/xattr.c
b/lib/xattr.c
index f860f2e6642937f9c8fb768afb33a42f0f1ced7c..651657f979cc65f4b4c3e619583020795341ffc5 100644
(file)
--- a/
lib/xattr.c
+++ b/
lib/xattr.c
@@
-1020,6
+1020,7
@@
char *erofs_export_xattr_ibody(struct erofs_inode *inode)
memset(buf + p, 0, size - p);
} else if (__erofs_unlikely(p > size)) {
DBG_BUGON(1);
+ free(buf);
return ERR_PTR(-EFAULT);
}
return buf;