Skip to content

Commit 1981b26

Browse files
committed
Fix check for 0x in NSAP parser
1 parent 6ced772 commit 1981b26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/generic/nsap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static really_inline int32_t parse_nsap(
2828
// hex string anywhere after "0x" for readability. The "."s have no
2929
// significance other than for readability and are not propagated in the
3030
// protocol (e.g., queries or zone transfers).
31-
if (unlikely((data[0] == '0') ^ ((data[1] & 0xdf) == 'X')))
31+
if (unlikely(data[0] != '0' || !(data[1] == 'X' || data[1] == 'x')))
3232
SYNTAX_ERROR(parser, "Invalid %s in %s", NAME(field), NAME(type));
3333

3434
data += 2;

0 commit comments

Comments
 (0)