[libnftnl PATCH 08/17] obj: synproxy: Use memcpy() to handle potentially unaligned data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Analogous to commit dc240913458d5 ("src: Use memcpy() to handle
potentially unaligned data").

Fixes: 609a13fc2999e ("src: synproxy stateful object support")
Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 src/obj/synproxy.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/obj/synproxy.c b/src/obj/synproxy.c
index baef5c201e83c..4ef97ece9306d 100644
--- a/src/obj/synproxy.c
+++ b/src/obj/synproxy.c
@@ -19,13 +19,13 @@ static int nftnl_obj_synproxy_set(struct nftnl_obj *e, uint16_t type,
 
 	switch (type) {
 	case NFTNL_OBJ_SYNPROXY_MSS:
-		synproxy->mss = *((uint16_t *)data);
+		memcpy(&synproxy->mss, data, data_len);
 		break;
 	case NFTNL_OBJ_SYNPROXY_WSCALE:
-		synproxy->wscale = *((uint8_t *)data);
+		memcpy(&synproxy->wscale, data, data_len);
 		break;
 	case NFTNL_OBJ_SYNPROXY_FLAGS:
-		synproxy->flags = *((uint32_t *)data);
+		memcpy(&synproxy->flags, data, data_len);
 		break;
 	default:
 		return -1;
-- 
2.43.0





[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux