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 cf81c84e43
commit 1d0a95b12a
1 changed files with 1 additions and 1 deletions

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;