From f1db4aec6569d7cf9e1fb84f1d9c1292032eac30 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 31 Jul 2009 16:12:13 -0700 Subject: [PATCH] don't crash in Parcel when given a null (and therfore invalid) native_handle_t --- libs/binder/Parcel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index f40e4bdc3e029..785a3c5ddb2dd 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -661,7 +661,7 @@ status_t Parcel::writeWeakBinder(const wp& val) status_t Parcel::writeNativeHandle(const native_handle* handle) { - if (handle->version != sizeof(native_handle)) + if (!handle || handle->version != sizeof(native_handle)) return BAD_TYPE; status_t err;