mirror of https://github.com/OpenIPC/firmware.git
14 lines
511 B
Diff
14 lines
511 B
Diff
diff -drupN a/drivers/nfc/st21nfca/dep.c b/drivers/nfc/st21nfca/dep.c
|
|
--- a/drivers/nfc/st21nfca/dep.c 2018-08-06 17:23:04.000000000 +0300
|
|
+++ b/drivers/nfc/st21nfca/dep.c 2022-06-12 05:28:14.000000000 +0300
|
|
@@ -217,7 +217,8 @@ static int st21nfca_tm_recv_atr_req(stru
|
|
|
|
atr_req = (struct st21nfca_atr_req *)skb->data;
|
|
|
|
- if (atr_req->length < sizeof(struct st21nfca_atr_req)) {
|
|
+ if (atr_req->length < sizeof(struct st21nfca_atr_req) ||
|
|
+ atr_req->length > skb->len) {
|
|
r = -EPROTO;
|
|
goto exit;
|
|
}
|