Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to segmentation fault (mbed-os/hal/source/mbed_ticker_api.c) #253

Open
MariwanJ opened this issue Feb 20, 2024 · 0 comments
Open

Comments

@MariwanJ
Copy link

MariwanJ commented Feb 20, 2024

at line 244

static void set_handler(const ticker_data_t *const ticker, ticker_event_handler handler)
{
    ticker->queue->event_handler = handler;
}

The above code doesn't check if "queue" is defined.
There are many other places at the same file that assume the queue is defined which is quite bad.
The way queue is defined quite complicated and still I didn't figure out how it works. I am sub-classing TimerEvent and there is a possibility to get that variable with NULL pointer.
There must be a check before doing that. Code shouldn't compile.
It causes HARD_FAULT.

Tested with Nucleo-F207ZG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant