Skip to content

Commit

Permalink
dlm: don't allow zero length names
Browse files Browse the repository at this point in the history
kobject doesn't like zero length object names, so let's test for that.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Signed-off-by: David Teigland <teigland@redhat.com>
  • Loading branch information
Tycho Andersen authored and David Teigland committed Nov 7, 2018
1 parent d968b4e commit 3f0806d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/dlm/lockspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ static int new_lockspace(const char *name, const char *cluster,
int do_unreg = 0;
int namelen = strlen(name);

if (namelen > DLM_LOCKSPACE_LEN)
if (namelen > DLM_LOCKSPACE_LEN || namelen == 0)
return -EINVAL;

if (!lvblen || (lvblen % 8))
Expand Down

0 comments on commit 3f0806d

Please sign in to comment.