This is an automated email from the ASF dual-hosted git repository.
dmeden pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 4dc6bede9c Fix undefined behavior doing memcpy from timespec** instead
from timespec* (#11356)
4dc6bede9c is described below
commit 4dc6bede9cb15ffa3e992c6b0a45781a4211d339
Author: Pavel Vazharov <[email protected]>
AuthorDate: Wed May 15 19:02:21 2024 +0300
Fix undefined behavior doing memcpy from timespec** instead from timespec*
(#11356)
The code was wrongly copying from timespec** to timespec*.
There was a warning emitted from GCC 13.2 about this.
---
src/iocore/net/UnixUDPNet.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/iocore/net/UnixUDPNet.cc b/src/iocore/net/UnixUDPNet.cc
index 92f44fd0e6..554031fbe3 100644
--- a/src/iocore/net/UnixUDPNet.cc
+++ b/src/iocore/net/UnixUDPNet.cc
@@ -97,7 +97,7 @@ UDPPacket::new_UDPPacket(struct sockaddr const *to,
ink_hrtime when, Ptr<IOBuffe
p->p.segment_size = segment_size;
#ifdef HAVE_SO_TXTIME
if (send_at_hint) {
- memcpy(&p->p.send_at, &send_at_hint, sizeof(struct timespec));
+ memcpy(&p->p.send_at, send_at_hint, sizeof(struct timespec));
}
#endif
return p;