don't crash in Parcel when given a null (and therfore invalid) native_handle_t

This commit is contained in:
Mathias Agopian
2009-07-31 16:12:13 -07:00
parent abac01052c
commit f1db4aec65

View File

@@ -661,7 +661,7 @@ status_t Parcel::writeWeakBinder(const wp<IBinder>& 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;