{"action":"created","issue":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/2911","labels_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/2911/labels{/name}","comments_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/2911/comments","events_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/2911/events","html_url":"https://github.com/MarlinFirmware/Marlin/issues/2911","id":127324398,"number":2911,"title":"enqueuecommand() - buffer overflow?","user":{"login":"AnHardt","id":211931,"avatar_url":"https://avatars.githubusercontent.com/u/211931?v=3","gravatar_id":"","url":"https://api.github.com/users/AnHardt","html_url":"https://github.com/AnHardt","followers_url":"https://api.github.com/users/AnHardt/followers","following_url":"https://api.github.com/users/AnHardt/following{/other_user}","gists_url":"https://api.github.com/users/AnHardt/gists{/gist_id}","starred_url":"https://api.github.com/users/AnHardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnHardt/subscriptions","organizations_url":"https://api.github.com/users/AnHardt/orgs","repos_url":"https://api.github.com/users/AnHardt/repos","events_url":"https://api.github.com/users/AnHardt/events{/privacy}","received_events_url":"https://api.github.com/users/AnHardt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-18T22:35:56Z","updated_at":"2016-01-29T13:44:20Z","closed_at":null,"body":"Could please someone check if\r\n```\r\nbool enqueuecommand(const char* cmd) {\r\n  if (*cmd == ';' || commands_in_queue >= BUFSIZE) return false;\r\n```\r\nshould better be\r\n```\r\nbool enqueuecommand(const char* cmd) {\r\n  if (*cmd == ';' || commands_in_queue >= BUFSIZE - 1 ) return false;\r\n```\r\n\r\nI could be wrong, but at other places\r\n```\r\nif (commands_in_queue < BUFSIZE - 1) get_command();\r\n```\r\n```\r\n  if (commands_in_queue < BUFSIZE - 1) get_command();\r\n```\r\nis used."},"comment":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/comments/176760794","html_url":"https://github.com/MarlinFirmware/Marlin/issues/2911#issuecomment-176760794","issue_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/2911","id":176760794,"user":{"login":"AnHardt","id":211931,"avatar_url":"https://avatars.githubusercontent.com/u/211931?v=3","gravatar_id":"","url":"https://api.github.com/users/AnHardt","html_url":"https://github.com/AnHardt","followers_url":"https://api.github.com/users/AnHardt/followers","following_url":"https://api.github.com/users/AnHardt/following{/other_user}","gists_url":"https://api.github.com/users/AnHardt/gists{/gist_id}","starred_url":"https://api.github.com/users/AnHardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnHardt/subscriptions","organizations_url":"https://api.github.com/users/AnHardt/orgs","repos_url":"https://api.github.com/users/AnHardt/repos","events_url":"https://api.github.com/users/AnHardt/events{/privacy}","received_events_url":"https://api.github.com/users/AnHardt/received_events","type":"User","site_admin":false},"created_at":"2016-01-29T13:44:19Z","updated_at":"2016-01-29T13:44:19Z","body":"If you are interested in my tests you could try to read https://github.com/AnHardt/Marlin/pull/14 commit by commit.\r\n\r\nPreliminary Result:\r\n1 Sending additional OKs with  (M280, M301, M304, M851, ??? ) is evil.\r\n2 Sending OKs for enqueuecommand() is evil.\r\n3 The 'hack' for 250000bd has a problem.\r\n4 115200bd seems to be ok when 1 and 2 are corrected."}}