-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Shell dereferences invalid pointer when printing demo command help #10195
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
Comments
This is what it prints before the issue:
|
@aescolar thanks for reporting. I have assigned it to the authors. |
Hi, |
@aescolar : Do you still observe this problem? |
@jarz-nordic : Yes, just do:
|
This being the output:
|
@jarz-nordic : Have you been able to reproduce it in native_posix? |
@aescolar : Not yet, today I was polishing my PR with shell documentation. I will take care tomorrow. |
@aescolar : I cannot find this branch: native_uart on your fork. |
@jarz-nordic That branch is already merged merged in master. So no need to fetch my branch anymore. |
@aescolar : I found a bug. In function
If you compile for POSIX this So I think we need to extend |
To prove my words you can modify function change code:
to:
|
There is no need to prove it :) |
I will close this task and start new one to update |
1. Function _vprintk is able to parse '*'. 2. Fixed checkpatch warnings. 3. Added Kconfig option to parse '*' only when SHELL is using _vprintk. 4. This PR fixes PR: zephyrproject-rtos#10195 and zephyrproject-rtos#10287 Signed-off-by: Jakub Rzeszutko <[email protected]>
This PR fixes: zephyrproject-rtos#10195. Function _vprintk when used cannot parse '*' what a as result causes dereferencing bad pointer. Signed-off-by: Jakub Rzeszutko <[email protected]>
This PR fixes: #10195. Function _vprintk when used cannot parse '*' what a as result causes dereferencing bad pointer. Signed-off-by: Jakub Rzeszutko <[email protected]>
On a shell over uart, typing "demo\r" without any option causes a bad pointer de-refence:
==30417== at 0x804AD0C: _vprintk (printk.c:196)
==30417== by 0x804FFA3: shell_fprintf_fmt (shell_fprintf.c:38)
==30417== by 0x804F7BD: shell_fprintf (shell.c:1409)
==30417== by 0x804FADC: help_item_print (shell.c:1537)
==30417== by 0x804FB62: help_options_print (shell.c:1561)
==30417== by 0x804FEB8: shell_help_print (shell.c:1662)
==30417== by 0x804EECB: shell_execute (shell.c:1080)
==30417== by 0x804E87C: shell_state_collect (shell.c:770)
==30417== by 0x804F69F: shell_process (shell.c:1366)
==30417== by 0x804F3B5: shell_thread (shell.c:1232)
==30417== Address 0xa is not stack'd, malloc'd or (recently) free'd
The text was updated successfully, but these errors were encountered: