From 12a1053dfa9f978d875402456c2c836140e9ad47 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 25 Jan 2022 08:57:49 +0100 Subject: [PATCH] - Fix #610: Undefine-shift in sldns_str2wire_hip_buf. --- sldns/str2wire.c | 4 +++- sldns/str2wire.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sldns/str2wire.c b/sldns/str2wire.c index 1e57211c1..c61a5964a 100644 --- a/sldns/str2wire.c +++ b/sldns/str2wire.c @@ -25,8 +25,10 @@ #include #endif +/** bits for the offset */ +#define RET_OFFSET_MASK (((unsigned)(~LDNS_WIREPARSE_MASK))>>LDNS_WIREPARSE_SHIFT) /** return an error */ -#define RET_ERR(e, off) ((int)((e)|((off)<>LDNS_WIREPARSE_SHIFT) +#define LDNS_WIREPARSE_OFFSET(e) ((((unsigned)(e))&~LDNS_WIREPARSE_MASK)>>LDNS_WIREPARSE_SHIFT) /* use lookuptable to get error string, sldns_wireparse_errors */ #define LDNS_WIREPARSE_ERR_OK 0 #define LDNS_WIREPARSE_ERR_GENERAL 342