{"action":"created","issue":{"url":"https://api.github.com/repos/iceman1001/ChameleonMini-rebooted/issues/56","repository_url":"https://api.github.com/repos/iceman1001/ChameleonMini-rebooted","labels_url":"https://api.github.com/repos/iceman1001/ChameleonMini-rebooted/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/iceman1001/ChameleonMini-rebooted/issues/56/comments","events_url":"https://api.github.com/repos/iceman1001/ChameleonMini-rebooted/issues/56/events","html_url":"https://github.com/iceman1001/ChameleonMini-rebooted/issues/56","id":359509818,"node_id":"MDU6SXNzdWUzNTk1MDk4MTg=","number":56,"title":"Out of bound for SPI_FLASH_INFOMY","user":{"login":"slurdge","id":1651201,"node_id":"MDQ6VXNlcjE2NTEyMDE=","avatar_url":"https://avatars0.githubusercontent.com/u/1651201?v=4","gravatar_id":"","url":"https://api.github.com/users/slurdge","html_url":"https://github.com/slurdge","followers_url":"https://api.github.com/users/slurdge/followers","following_url":"https://api.github.com/users/slurdge/following{/other_user}","gists_url":"https://api.github.com/users/slurdge/gists{/gist_id}","starred_url":"https://api.github.com/users/slurdge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slurdge/subscriptions","organizations_url":"https://api.github.com/users/slurdge/orgs","repos_url":"https://api.github.com/users/slurdge/repos","events_url":"https://api.github.com/users/slurdge/events{/privacy}","received_events_url":"https://api.github.com/users/slurdge/received_events","type":"User","site_admin":false},"labels":[{"id":761183246,"node_id":"MDU6TGFiZWw3NjExODMyNDY=","url":"https://api.github.com/repos/iceman1001/ChameleonMini-rebooted/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-12T14:33:19Z","updated_at":"2018-09-27T12:55:14Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"If you look at https://github.com/iceman1001/ChameleonMini-rebooted/blob/master/Firmware/Chameleon-Mini/Terminal/Commands.h#L61, you will see that the max length for a command is  `16`. But this should be including the final `0`.\r\nAs `len(\"SPI_FLASH_INFOMY\") == 16`, when displaying commands or interpreting them there is an out of bound access to the next member of the struct, `ExecFunc`.\r\nWe should either do a +1 inside the struct to accomodate for the final `0`:\r\n```C\r\nchar Command[MAX_COMMAND_LENGTH + 1]; //for final \\0\r\n```\r\nor change the value of `MAX_COMMAND_LENGTH`.\r\n\r\nHowever my board is still dead so I can't test&propose a PR right now. This bug is just a reminder that this should be checked in the future."},"comment":{"url":"https://api.github.com/repos/iceman1001/ChameleonMini-rebooted/issues/comments/425079724","html_url":"https://github.com/iceman1001/ChameleonMini-rebooted/issues/56#issuecomment-425079724","issue_url":"https://api.github.com/repos/iceman1001/ChameleonMini-rebooted/issues/56","id":425079724,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTA3OTcyNA==","user":{"login":"slurdge","id":1651201,"node_id":"MDQ6VXNlcjE2NTEyMDE=","avatar_url":"https://avatars0.githubusercontent.com/u/1651201?v=4","gravatar_id":"","url":"https://api.github.com/users/slurdge","html_url":"https://github.com/slurdge","followers_url":"https://api.github.com/users/slurdge/followers","following_url":"https://api.github.com/users/slurdge/following{/other_user}","gists_url":"https://api.github.com/users/slurdge/gists{/gist_id}","starred_url":"https://api.github.com/users/slurdge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slurdge/subscriptions","organizations_url":"https://api.github.com/users/slurdge/orgs","repos_url":"https://api.github.com/users/slurdge/repos","events_url":"https://api.github.com/users/slurdge/events{/privacy}","received_events_url":"https://api.github.com/users/slurdge/received_events","type":"User","site_admin":false},"created_at":"2018-09-27T12:55:14Z","updated_at":"2018-09-27T12:55:14Z","author_association":"CONTRIBUTOR","body":"Since I could reprogram my unit, I could test the change.\r\nUnfortunately, changing `MAX_COMMAND_LENGTH` does not work. Since it's in PROGMEM, I believe there's an issue that this struct is strangely overlapping other stuff. 100% of the time, if `MAX_COMMAND_LENGTH > 16`, then the 8th entry does not work (and that probably how I bricked my unit in the first place, added with other bugs ?).\r\n\r\nSo, reducing the command by 1 byte is much safer and easier IMO. I'll also put a warning regarding the size in the PR."}}
{"actor":{"display_login":"slurdge"}}