diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2016-05-09 13:28:49 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-25 17:33:47 -0400 |
commit | aaf431b4f92152d46ab54079692633aa422262b1 (patch) | |
tree | 459a45a5dbd76d3698535f76e6be0f8981354070 /fs | |
parent | e0d46f5c6e0ba3a79e64cd60e62b7b7191ed93f3 (diff) |
xattr: Fail with -EINVAL for NULL attribute names
Commit 98e9cb57 improved the xattr name checks in xattr_resolve_name but
didn't update the NULL attribute name check appropriately, so NULL
attribute names lead to NULL pointer dereferences. Turn that into
-EINVAL results instead.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/xattr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xattr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xattr.c b/fs/xattr.c index b11945e15fde..4231488f2122 100644 --- a/fs/xattr.c +++ b/fs/xattr.c @@ -668,7 +668,7 @@ xattr_resolve_name(const struct xattr_handler **handlers, const char **name) const struct xattr_handler *handler; if (!*name) - return NULL; + return ERR_PTR(-EINVAL); for_each_xattr_handler(handlers, handler) { const char *n; |