You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/10/21 08:31:17 UTC

[incubator-nuttx-apps] branch master updated (6fb173e3d -> f6ab04add)

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


    from 6fb173e3d netutils: webserver: Fix directory handling
     new cfb64cffb netlib_getarptab: fix codechecker high level issue
     new f6ab04add dhcpc: codechecker issuse fix

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 netutils/dhcpc/dhcpc.c             | 2 ++
 netutils/netlib/netlib_getarptab.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)


[incubator-nuttx-apps] 01/02: netlib_getarptab: fix codechecker high level issue

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit cfb64cffb165eef61336cb8530ebeffd74aded77
Author: zhanghongyu <zh...@xiaomi.com>
AuthorDate: Wed Oct 12 17:28:56 2022 +0800

    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 <zh...@xiaomi.com>
---
 netutils/netlib/netlib_getarptab.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/netutils/netlib/netlib_getarptab.c b/netutils/netlib/netlib_getarptab.c
index ad2b0c9d1..477f1b487 100644
--- a/netutils/netlib/netlib_getarptab.c
+++ b/netutils/netlib/netlib_getarptab.c
@@ -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)


[incubator-nuttx-apps] 02/02: dhcpc: codechecker issuse fix

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit f6ab04addb97b22c488db2910d3582c31692db24
Author: zhanghongyu <zh...@xiaomi.com>
AuthorDate: Fri Oct 21 11:04:52 2022 +0800

    dhcpc: codechecker issuse fix
    
    presult->serverid.s_addr maybe is garbage or undefined
    
    Signed-off-by: zhanghongyu <zh...@xiaomi.com>
---
 netutils/dhcpc/dhcpc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/netutils/dhcpc/dhcpc.c b/netutils/dhcpc/dhcpc.c
index eb5be2f43..92f484364 100644
--- a/netutils/dhcpc/dhcpc.c
+++ b/netutils/dhcpc/dhcpc.c
@@ -696,6 +696,8 @@ int dhcpc_request(FAR void *handle, FAR struct dhcpc_state *presult)
   int     state;
   clock_t start;
 
+  memset(presult, 0, sizeof(*presult));
+
   /* RFC2131: For example, a client may choose a different,
    * random initial 'xid' each time the client is rebooted, and
    * subsequently use sequential 'xid's until the next reboot.