From 26d86ce4499ba06fa220d9529f198a3c50b61d68 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Thu, 16 May 2019 23:38:51 -0700 Subject: [PATCH] Added canary check to mitigate crash on linux --- microstack/ILibProcessPipe.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/microstack/ILibProcessPipe.c b/microstack/ILibProcessPipe.c index 7229290..d43c74a 100644 --- a/microstack/ILibProcessPipe.c +++ b/microstack/ILibProcessPipe.c @@ -496,11 +496,17 @@ void ILibProcessPipe_Manager_OnPostSelect(void* object, int slct, fd_set *readse while(node != NULL && (j = (ILibProcessPipe_PipeObject*)ILibLinkedList_GetDataFromNode(node)) != NULL) { nextNode = ILibLinkedList_GetNextNode(node); - if(FD_ISSET(j->mPipe_ReadEnd, readset) != 0) + if (ILibMemory_CanaryOK(j)) { - ILibProcessPipe_Process_ReadHandler(j); + if (FD_ISSET(j->mPipe_ReadEnd, readset) != 0) + { + ILibProcessPipe_Process_ReadHandler(j); + } + } + else + { + ILibLinkedList_Remove(node); } - node = nextNode; } }