libbinder: Fix PAD_SIZE_UNSAFE
Building libbinder with UBSan on Trusty revealed an error
in the PAD_SIZE_UNSAFE macro.
Bug: None
Test: m
Change-Id: I3b0968488eb43f5aae02fcf3813e9948362e1749
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index f84f639..7612800 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -63,7 +63,7 @@
// This macro should never be used at runtime, as a too large value
// of s could cause an integer overflow. Instead, you should always
// use the wrapper function pad_size()
-#define PAD_SIZE_UNSAFE(s) (((s)+3)&~3)
+#define PAD_SIZE_UNSAFE(s) (((s) + 3) & ~3UL)
static size_t pad_size(size_t s) {
if (s > (std::numeric_limits<size_t>::max() - 3)) {