]>
The Tcpdump Group git mirrors - libpcap/commit
Use the EXTRACT_ macros to extract big-endian integers from a buffer.
This:
1) makes it a bit clearer what the code is doing;
2) means that on platforms that support unaligned accesses, the
generated code involves fewer instructions;
3) squelches an undefined behavior warning from shifting an int value
left 24 bits (in practice, it works, but...).
Also, note that we do too much signed integer stuff here.
Credit to OSS-Fuzz for finding the undefined behavior issue.