chEvtGetAndClearFlags(...) does not mask events Topic is solved
Posted: Wed Sep 05, 2018 4:20 pm
chEvtGetAndClearFlags(..) returns all flags set on the event source.
It should only return those in the mask.
This causes an issue if using chEvtDispatch(...) to execute functions.
i.e. flags outside the expected masked range will access invalid pointer(s).
It should only return those in the mask.
This causes an issue if using chEvtDispatch(...) to execute functions.
i.e. flags outside the expected masked range will access invalid pointer(s).
Code: Select all
Index: chevents.c
===================================================================
--- chevents.c (revision 12234)
+++ chevents.c (working copy)
@@ -262,7 +262,7 @@
elp->flags = (eventflags_t)0;
chSysUnlock();
- return flags;
+ return flags & elp->wflags;
}
/**