mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
netlib_getarptab: fix codechecker high level issue
197: paysize = RTA_PAYLOAD(&resp->attr);
198: if (paysize > maxsize)
199: {
200: paysize = maxsize;
201: }
202:
203: memcpy(arptab, resp->data, paysize);
Memory copy function accesses out-of-bound array element
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
6fb173e3d5
commit
cfb64cffb1
1 changed files with 1 additions and 1 deletions
|
|
@ -99,7 +99,7 @@ ssize_t netlib_get_arptable(FAR struct arp_entry_s *arptab,
|
|||
|
||||
/* Pre-allocate a buffer to hold the response */
|
||||
|
||||
maxsize = CONFIG_NET_ARPTAB_SIZE * sizeof(struct arp_entry_s);
|
||||
maxsize = nentries * sizeof(struct arp_entry_s);
|
||||
allocsize = SIZEOF_NETLIB_RECVFROM_RESPONSE_S(maxsize);
|
||||
resp = (FAR struct netlib_recvfrom_response_s *)malloc(allocsize);
|
||||
if (resp == NULL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue