diff --git a/winpr/libwinpr/utils/collections/MessageQueue.c b/winpr/libwinpr/utils/collections/MessageQueue.c index 4cda9904a..3e269a796 100644 --- a/winpr/libwinpr/utils/collections/MessageQueue.c +++ b/winpr/libwinpr/utils/collections/MessageQueue.c @@ -70,6 +70,9 @@ BOOL MessageQueue_Wait(wMessageQueue* queue) BOOL MessageQueue_Dispatch(wMessageQueue* queue, wMessage* message) { BOOL ret = FALSE; + if (!queue || !message) + return FALSE; + EnterCriticalSection(&queue->lock); if (queue->size == queue->capacity)