Make the 7 used when rounding up a size unsigned.
"7" is signed, and C's promotion etc. rules cause it to be
sign-extended. This probably doesn't cause a problem in practice, but
it does cause undefined behavior sanitizers to complain.
Use 7U, to ensure it's all unsigned.
This should address the pcap.c part of GitHub issue
the-tcpdump-group/tcpdump#785.
diff --git a/pcap.c b/pcap.c
index 10f60ff..a232e3c 100644
--- a/pcap.c
+++ b/pcap.c
@@ -2279,7 +2279,7 @@
* require 8-byte alignment even on platforms with 32-bit
* integers.
*/
-#define PCAP_T_ALIGNED_SIZE ((sizeof(pcap_t) + 7) & ~0x7)
+#define PCAP_T_ALIGNED_SIZE ((sizeof(pcap_t) + 7U) & ~0x7U)
chunk = malloc(PCAP_T_ALIGNED_SIZE + size);
if (chunk == NULL) {
pcap_fmt_errmsg_for_errno(ebuf, PCAP_ERRBUF_SIZE,