mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-03 17:40:04 +00:00
ovl: check snprintf return
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
parent
520eccdfe1
commit
6787341a0f
1 changed files with 3 additions and 0 deletions
|
@ -498,6 +498,9 @@ static int ovl_set_nlink_common(struct dentry *dentry,
|
|||
len = snprintf(buf, sizeof(buf), format,
|
||||
(int) (inode->i_nlink - realinode->i_nlink));
|
||||
|
||||
if (WARN_ON(len >= sizeof(buf)))
|
||||
return -EIO;
|
||||
|
||||
return ovl_do_setxattr(ovl_dentry_upper(dentry),
|
||||
OVL_XATTR_NLINK, buf, len, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue