Fix UB: Make read_int() follow SEI CERT INT13-C and INT34-C.
Follow:
- INT13-C. Use bitwise operators only on unsigned operands
- INT34-C. Do not shift an expression by a negative number of bits or by
greater than or equal to the number of bits that exist in the operand
to fix undefined behavior when read_int() reads int larger than 4 bytes,
which is part of apply and dump stored metadata flows.
Issue can be spotted with -fsanitize=undefined.
src/utils.c:160:34: runtime error: shift exponent 32 is too large for 32-bit type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/utils.c:160:34 in
It does not fix possible UB for reading integers larger than 8 bytes,
but there are no such use cases right now.