From 6fe770bb213e06525fac1bf605d56397ccf0bc52 Mon Sep 17 00:00:00 2001 From: Simon Liedl Date: Mon, 30 Jul 2018 12:50:04 +0000 Subject: [PATCH] Merged in sliedl/nuttx (pull request #700) sched/mqueue/mq_notify.c: Fix - only part of struct copied to internal structure As source adress the adress of the struct member sigev_value was used, and it is not located the start of the struct. This leads to invalid data being copied to internal structure. Both source and destination should be of type struct sigevent* . Approved-by: GregoryN --- sched/mqueue/mq_notify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sched/mqueue/mq_notify.c b/sched/mqueue/mq_notify.c index 862f99adc96..a6abf3d92ce 100644 --- a/sched/mqueue/mq_notify.c +++ b/sched/mqueue/mq_notify.c @@ -152,7 +152,7 @@ int mq_notify(mqd_t mqdes, FAR const struct sigevent *notification) /* Yes... Assign it to the current task. */ - memcpy(&msgq->ntevent, ¬ification->sigev_value, + memcpy(&msgq->ntevent, notification, sizeof(struct sigevent)); msgq->ntpid = rtcb->pid;