Merge "native handle - fix ubsan abort"
diff --git a/Parcel.cpp b/Parcel.cpp
index d95b0c3..6393bed 100644
--- a/Parcel.cpp
+++ b/Parcel.cpp
@@ -1464,8 +1464,8 @@
         return status;
     }
 
-    if (nativeHandleSize < sizeof(native_handle_t)) {
-        ALOGE("Received a native_handle_t size that was too small.");
+    if (nativeHandleSize < sizeof(native_handle_t) || nativeHandleSize > std::numeric_limits<uint32_t>::max()) {
+        ALOGE("Invalid native_handle_t size: %" PRIu64, nativeHandleSize);
         return BAD_VALUE;
     }