[riot-notifications] [RIOT-OS/RIOT] sys/shell: commands: Check argc in _pm_handler (#14005)

François Berder notifications at github.com
Sat May 2 22:11:20 CEST 2020


### Contribution description

I noticed that the command `pm` is now available in the shell when a board is flashed with `examples/default`. However, when I only entered `pm` and not `pm off`, I got a data bus error on a 6lowpan-clicker. On a pic32-wifire, the board reboots.

This is due to accessing args out-of-bound in function `_pm_handler` at line 153 and line 189. 

### Testing procedure

Flash `examples/default` on a board. If you only type `pm`, the board should not crash/reboot. It should simply print how to use this command.

### Issues/PRs references

None. Found while working on #13820 .
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/14005

-- Commit Summary --

  * sys/shell: commands: Check argc in _pm_handler

-- File Changes --

    M sys/shell/commands/sc_pm.c (7)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/14005.patch
https://github.com/RIOT-OS/RIOT/pull/14005.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/14005
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200502/e2b6ad68/attachment.htm>


More information about the notifications mailing list