This is an automated email from the ASF dual-hosted git repository.
acassis 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 5ac8c71663 net/ipfrag:Fixed ref not initializing warning issue
5ac8c71663 is described below
commit 5ac8c716632fa43077b6957c65ec76e7444f6134
Author: wangyingdong <[email protected]>
AuthorDate: Wed Jul 26 14:44:29 2023 +0800
net/ipfrag:Fixed ref not initializing warning issue
CC: libssh/src/auth.c
1ipfrag/ipv4_frag.c: In function 'ipv4_fragout':
ipfrag/ipv4_frag.c:224:7: error: 'ref' may be used uninitialized in this
function [-Werror-maybe-uninitialized]
224 | lmemcpy(ipv4, ref, iphdrlen);
ipfrag/ipv4_frag.c:364:26: note: 'ref' was declared here
364 | FAR struct ipv4_hdr_s *ref;
CC: tls/task initinfo c
Signed-off-by: wangyingdong <[email protected]>
---
net/ipfrag/ipv4_frag.c | 2 +-
net/ipfrag/ipv6_frag.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipfrag/ipv4_frag.c b/net/ipfrag/ipv4_frag.c
index acec0029a8..0d467eb60d 100644
--- a/net/ipfrag/ipv4_frag.c
+++ b/net/ipfrag/ipv4_frag.c
@@ -361,7 +361,7 @@ int32_t ipv4_fragout(FAR struct net_driver_s *dev, uint16_t
mtu)
uint16_t offset = 0;
uint16_t hdrlen;
FAR struct iob_s *frag;
- FAR struct ipv4_hdr_s *ref;
+ FAR struct ipv4_hdr_s *ref = NULL;
struct iob_queue_s fragq =
{
NULL, NULL
diff --git a/net/ipfrag/ipv6_frag.c b/net/ipfrag/ipv6_frag.c
index c49cc2f0b5..ab19cab73b 100644
--- a/net/ipfrag/ipv6_frag.c
+++ b/net/ipfrag/ipv6_frag.c
@@ -569,7 +569,7 @@ int32_t ipv6_fragout(FAR struct net_driver_s *dev, uint16_t
mtu)
uint16_t hdroff;
uint16_t hdrtype;
FAR struct iob_s *frag;
- FAR struct ipv6_hdr_s *ref;
+ FAR struct ipv6_hdr_s *ref = NULL;
FAR struct ipv6_fragment_extension_s *fraghdr;
struct iob_queue_s fragq =
{