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/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 5fc016ef2d ipv6_frag.c:modify the type of the parameters to solve
runtime error
5fc016ef2d is described below
commit 5fc016ef2dd96fa9ed6f5251397e81706aa8abc5
Author: wangchen <[email protected]>
AuthorDate: Tue Oct 17 19:31:03 2023 +0800
ipv6_frag.c:modify the type of the parameters to solve runtime error
Signed-off-by: wangchen <[email protected]>
---
net/ipfrag/ipv6_frag.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/ipfrag/ipv6_frag.c b/net/ipfrag/ipv6_frag.c
index a46dcd86a2..36bd94d80c 100644
--- a/net/ipfrag/ipv6_frag.c
+++ b/net/ipfrag/ipv6_frag.c
@@ -141,8 +141,9 @@ static int32_t ipv6_fragin_getinfo(FAR struct iob_s *iob,
fraglink->morefrags = fraglink->fragoff & 0x1;
fraglink->fragoff &= 0xfff8;
fraglink->fraglen = paylen;
- fraglink->ipid = NTOHL((*(uint16_t *)(&fraghdr->id[0]) << 16) +
- *(uint16_t *)(&fraghdr->id[2]));
+ fraglink->ipid = NTOHL(
+ ((uint32_t)(*(FAR uint16_t *)(&fraghdr->id[0])) << 16) +
+ (uint32_t)(*(FAR uint16_t *)(&fraghdr->id[2])));
fraglink->frag = iob;