Bug in gpt_lld.c Callback pointer not verified.
Posted: Fri Jan 10, 2014 9:17 pm
release 2.6.2
I just fell into this bug, defining the callback NULL causes a crash
the code misses a check that the pointer is not NULL
original code:
/Svend
I just fell into this bug, defining the callback NULL causes a crash
the code misses a check that the pointer is not NULL
if (gptp->config->callback != NULL )
gptp->config->callback(gptp);
original code:
/**
* @brief Shared IRQ handler.
*
* @param[in] gptp pointer to a @p GPTDriver object
*/
static void gpt_lld_serve_interrupt(GPTDriver *gptp) {
gptp->tim->SR = 0;
if (gptp->state == GPT_ONESHOT) {
gptp->state = GPT_READY; /* Back in GPT_READY state. */
gpt_lld_stop_timer(gptp); /* Timer automatically stopped. */
}
gptp->config->callback(gptp);
}
/Svend