This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new d4290b3 Fix error: 'memset' forming offset [16, 27] is out of the
bounds [0, 16] of object 'inaddr' with type 'union <anonymous>'
d4290b3 is described below
commit d4290b3e93dd46aa43a259d0c3a1a877656eaa51
Author: Xiang Xiao <[email protected]>
AuthorDate: Sat Mar 5 21:56:12 2022 +0800
Fix error: 'memset' forming offset [16, 27] is out of the bounds [0, 16] of
object 'inaddr' with type 'union <anonymous>'
Signed-off-by: Xiang Xiao <[email protected]>
---
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 6ceb896..c2b91ab 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;