cifs: fix leak in FSCTL_ENUM_SNAPS response handling
authorDavid Disseldorp <ddiss@suse.de>
Wed, 3 May 2017 15:39:09 +0000 (17:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 May 2017 12:28:40 +0000 (14:28 +0200)
commit449a74439d1525b43357be9da42b84fcdbd6b5a9
treef61d516aef76cfeb9e8a186101bc6c7b197f6f41
parent87c0604d860ffcef347510a798dbb5fe681a4b65
cifs: fix leak in FSCTL_ENUM_SNAPS response handling

commit 0e5c795592930d51fd30d53a2e7b73cba022a29b upstream.

The server may respond with success, and an output buffer less than
sizeof(struct smb_snapshot_array) in length. Do not leak the output
buffer in this case.

Fixes: 834170c85978 ("Enable previous version support")
Signed-off-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2ops.c