Skip to content
  • Ondřej Surý's avatar
    Fix comparison between type uint16_t and wider type size_t in a loop · a9bd6f6e
    Ondřej Surý authored and Mark Andrews's avatar Mark Andrews committed
    Found by LGTM.com (see below for description), and while it should not
    happen as EDNS OPT RDLEN is uint16_t, the fix is easy.  A little bit
    of cleanup is included too.
    
    > In a loop condition, comparison of a value of a narrow type with a value
    > of a wide type may result in unexpected behavior if the wider value is
    > sufficiently large (or small). This is because the narrower value may
    > overflow. This can lead to an infinite loop.
    a9bd6f6e