From 707b24e5cbdc3b934c848d3decdb49f41b6cd4f1 Mon Sep 17 00:00:00 2001 From: Alan Carvalho de Assis Date: Tue, 7 Jul 2026 19:13:22 -0300 Subject: [PATCH] system/ping: Fix a segmentation fault when using ping nsh> ping google.com [ 37.180000] dns_query_error: ERROR: IPv4 dns_recv_response fa: -84, server address: 8.8.8.8 Segmentation fault. Signed-off-by: Alan C. Assis --- system/ping/ping.c | 2 ++ system/ping6/ping6.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/system/ping/ping.c b/system/ping/ping.c index 4588393ab..bc5e20ea8 100644 --- a/system/ping/ping.c +++ b/system/ping/ping.c @@ -345,6 +345,8 @@ int main(int argc, FAR char *argv[]) int exitcode; int option; + memset(&info, 0, sizeof(info)); + info.count = ICMP_NPINGS; info.datalen = ICMP_PING_DATALEN; info.delay = ICMP_POLL_DELAY; diff --git a/system/ping6/ping6.c b/system/ping6/ping6.c index 409f3db0e..e4644ede6 100644 --- a/system/ping6/ping6.c +++ b/system/ping6/ping6.c @@ -286,6 +286,8 @@ int main(int argc, FAR char *argv[]) int exitcode; int option; + memset(&info, 0, sizeof(info)); + info.count = ICMPv6_NPINGS; info.datalen = ICMPv6_PING6_DATALEN; info.delay = ICMPv6_POLL_DELAY;