diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-28 13:33:37 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-28 13:33:37 +0200 |
commit | a0306db6e5758b0488c79e739de3c0ffe47ea62f (patch) | |
tree | 86d17769496f96554f89bfc3be02b645a420889f /drivers/staging | |
parent | 4bc07aa4f030d4d3e551ce8d96ca15b6424a5641 (diff) | |
parent | 3eb2ce825ea1ad89d20f7a3b5780df850e4be274 (diff) |
Merge 4.16-rc7 into staging-next
We want the IIO and staging driver fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/ncpfs/ncplib_kernel.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/ncpfs/ncplib_kernel.c b/drivers/staging/ncpfs/ncplib_kernel.c index 804adfebba2f..3e047eb4cc7c 100644 --- a/drivers/staging/ncpfs/ncplib_kernel.c +++ b/drivers/staging/ncpfs/ncplib_kernel.c @@ -981,6 +981,10 @@ ncp_read_kernel(struct ncp_server *server, const char *file_id, goto out; } *bytes_read = ncp_reply_be16(server, 0); + if (*bytes_read > to_read) { + result = -EINVAL; + goto out; + } source = ncp_reply_data(server, 2 + (offset & 1)); memcpy(target, source, *bytes_read); |