Skip to content

Commit

Permalink
dns: rtype check that it is positive, as suggested by @reynir
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesm committed Apr 1, 2022
1 parent 1d2d9b8 commit 8c60384
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dns.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,7 @@ module Rr_map = struct
let of_int ?(off = 0) i = match i with
| 1 | 2 | 5 | 6 | 12 | 15 | 16 | 28 | 33 | 41 | 43 | 44 | 46 | 47 | 48 | 50 | 52 | 250 | 251 | 252 | 255 | 257 ->
Error (`Malformed (off, "reserved and supported RTYPE not Unknown"))
| x -> if x < 1 lsl 16 then Ok x else Error (`Malformed (off, "RTYPE exceeds 16 bit"))
| x -> if x >= 0 && x < 1 lsl 16 then Ok x else Error (`Malformed (off, "RTYPE exceeds 16 bit"))
let to_int t = t
let compare = int_compare
end
Expand Down

0 comments on commit 8c60384

Please sign in to comment.