From d4290b3e93dd46aa43a259d0c3a1a877656eaa51 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sat, 5 Mar 2022 21:56:12 +0800 Subject: [PATCH] Fix error: 'memset' forming offset [16, 27] is out of the bounds [0, 16] of object 'inaddr' with type 'union ' Signed-off-by: Xiang Xiao --- nshlib/nsh_routecmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nshlib/nsh_routecmds.c b/nshlib/nsh_routecmds.c index 6ceb89650..c2b91ab95 100644 --- a/nshlib/nsh_routecmds.c +++ b/nshlib/nsh_routecmds.c @@ -327,7 +327,7 @@ int cmd_addroute(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) * /128 -> ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff */ - memset(&inaddr.ipv6, 0, sizeof(struct sockaddr_in6)); + memset(&inaddr.ipv6, 0, sizeof(inaddr.ipv6)); for (i = 0; i < 8 && shift >= 16; i++, shift -= 16) { inaddr.ipv6.s6_addr16[i] = 0xffff;