From f94baef84e3e98cd94dc7f8662a5f6f24135c124 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Wed, 23 Oct 2013 15:46:23 +0200 Subject: [PATCH] android/hal: Fix crash while receiving notification This fix following crash: Invalid read of size 8 at 0x408B33: notification_handler (hal-ipc.c:122) by 0x4E39E99: start_thread (pthread_create.c:308) Address 0x8 is not stack'd, malloc'd or (recently) free'd --- android/hal-ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/hal-ipc.c b/android/hal-ipc.c index e8bba1102..97a3d295c 100644 --- a/android/hal-ipc.c +++ b/android/hal-ipc.c @@ -118,7 +118,7 @@ static void *notification_handler(void *data) fd = -1; /* Receive auxiliary data in msg */ - for (cmsg = CMSG_FIRSTHDR(&msg); !cmsg; + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { -- 2.47.3