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

Null pointer dereference in CLI led #13704

Open
HorizontalCar opened this issue Jun 18, 2024 · 1 comment
Open

Null pointer dereference in CLI led #13704

HorizontalCar opened this issue Jun 18, 2024 · 1 comment
Labels
BUG Bugs are excluded from automatically being marked as stale

Comments

@HorizontalCar
Copy link

Describe the bug

CLI can call parseLedStripConfig with null argument for config if not enough arguments are passed. The code should check that the return value of nextArg is non-null at:

ptr = nextArg(cmdline);

Otherwise result in a null pointer dereference at:

if (parseLedStripConfig(i, ptr)) {

To Reproduce

In CLI mode:

Entering CLI Mode, type 'exit' to return, or 'help'

# led +

Expected behavior

Does not crash on incorrect use of CLI led

Support ID

N/A

Flight controller

N/A

Other components

No response

How are the different components wired up (including port information)

No response

Add any other context about the problem that you think might be relevant here

I've been testing automated firmware testing tools on Betaflight firmware, so I am not using the firmware directly. Instead, I am emulating it in a testing environment and manually triaging the crashes I find. During my testing, I found inputs that trigger a null pointer dereference in CLI mode.

@HorizontalCar HorizontalCar added the Template: Bug Set by auto_close_issue. label Jun 18, 2024
@haslinghuis
Copy link
Member

Result:

# led +
###ERROR IN led: PARSING FAILED###

@haslinghuis haslinghuis added BUG Bugs are excluded from automatically being marked as stale and removed Template: Bug Set by auto_close_issue. labels Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Bugs are excluded from automatically being marked as stale
Projects
None yet
Development

No branches or pull requests

2 participants