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

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit b9c772ed135bc3e8baa44147d8c49000c6005d7e
Author: wangzitong7 <[email protected]>
AuthorDate: Mon Aug 17 19:58:12 2026 +0800

    net/arp: Assert that arp_update receives a device.
    
    arp_update() requires a valid device: every caller passes one that is
    already resolved, netdev_arp_ioctl() even tests it before the call,
    and the function dereferences dev unconditionally when it queues
    pending ARP output.  State that precondition with DEBUGASSERT()
    instead of leaving it implicit.
    
    Signed-off-by: wangzitong7 <[email protected]>
---
 net/arp/arp_table.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/arp/arp_table.c b/net/arp/arp_table.c
index d5d7d1c593d..561582dad44 100644
--- a/net/arp/arp_table.c
+++ b/net/arp/arp_table.c
@@ -317,6 +317,8 @@ int arp_update(FAR struct net_driver_s *dev, in_addr_t 
ipaddr,
 #endif
   int i;
 
+  DEBUGASSERT(dev != NULL);
+
   /* Walk through the ARP mapping table and try to find an entry to
    * update. If none is found, the IP -> MAC address mapping is
    * inserted in the ARP table.

Reply via email to