summaryrefslogtreecommitdiffstats
path: root/net/nfc/llcp_commands.c
diff options
context:
space:
mode:
authorLinus Walleij2018-03-18 17:48:59 +0100
committerLinus Walleij2018-03-18 17:48:59 +0100
commit95260c17b27e4bdacf85022e629fb701b42cc190 (patch)
treecfc6963180d99e5f36752ca028821aaa109e860d /net/nfc/llcp_commands.c
parentgpio: mockup: Update Bamvors mail address (diff)
parentLinux 4.16-rc5 (diff)
downloadkernel-qcow2-linux-95260c17b27e4bdacf85022e629fb701b42cc190.tar.gz
kernel-qcow2-linux-95260c17b27e4bdacf85022e629fb701b42cc190.tar.xz
kernel-qcow2-linux-95260c17b27e4bdacf85022e629fb701b42cc190.zip
Merge tag 'v4.16-rc5' into devel
Linux 4.16-rc5 merged into the GPIO devel branch to resolve a nasty conflict between fixes and devel in the RCAR driver. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'net/nfc/llcp_commands.c')
-rw-r--r--net/nfc/llcp_commands.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/nfc/llcp_commands.c b/net/nfc/llcp_commands.c
index 367d8c027101..2ceefa183cee 100644
--- a/net/nfc/llcp_commands.c
+++ b/net/nfc/llcp_commands.c
@@ -149,6 +149,10 @@ struct nfc_llcp_sdp_tlv *nfc_llcp_build_sdreq_tlv(u8 tid, char *uri,
pr_debug("uri: %s, len: %zu\n", uri, uri_len);
+ /* sdreq->tlv_len is u8, takes uri_len, + 3 for header, + 1 for NULL */
+ if (WARN_ON_ONCE(uri_len > U8_MAX - 4))
+ return NULL;
+
sdreq = kzalloc(sizeof(struct nfc_llcp_sdp_tlv), GFP_KERNEL);
if (sdreq == NULL)
return NULL;