Skip to content

Commit

Permalink
dm ioctl: do not leak argv if target message only contains whitespace
Browse files Browse the repository at this point in the history
If 'argc' is zero we jump to the 'out:' label, but this leaks the
(unused) memory that 'dm_split_args()' allocated for 'argv' if the
string being split consisted entirely of whitespace.  Jump to the
'out_argv:' label instead to free up that memory.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
jjuhl authored and kergon committed Mar 7, 2012
1 parent 192cfd5 commit 902c6a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/dm-ioctl.c
Expand Up @@ -1437,7 +1437,7 @@ static int target_message(struct dm_ioctl *param, size_t param_size)

if (!argc) {
DMWARN("Empty message received.");
goto out;
goto out_argv;
}

table = dm_get_live_table(md);
Expand Down

0 comments on commit 902c6a9

Please sign in to comment.