From 486b7e58d6f66e0a700fbf83a713267d6984757f Mon Sep 17 00:00:00 2001 From: Pavel Vazharov Date: Wed, 15 May 2024 12:01:23 +0300 Subject: [PATCH] Fix undefined behavior doing memcpy from timespec** instead from timespec* 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 92f44fd0e6d..554031fbe33 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, Ptrp.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;