{"action":"created","issue":{"url":"https://api.github.com/repos/gomqtt/message/issues/5","labels_url":"https://api.github.com/repos/gomqtt/message/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/gomqtt/message/issues/5/comments","events_url":"https://api.github.com/repos/gomqtt/message/issues/5/events","html_url":"https://github.com/gomqtt/message/pull/5","id":103101481,"number":5,"title":"Fuzzing (WIP)","user":{"login":"256dpi","id":696886,"avatar_url":"https://avatars.githubusercontent.com/u/696886?v=3","gravatar_id":"","url":"https://api.github.com/users/256dpi","html_url":"https://github.com/256dpi","followers_url":"https://api.github.com/users/256dpi/followers","following_url":"https://api.github.com/users/256dpi/following{/other_user}","gists_url":"https://api.github.com/users/256dpi/gists{/gist_id}","starred_url":"https://api.github.com/users/256dpi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/256dpi/subscriptions","organizations_url":"https://api.github.com/users/256dpi/orgs","repos_url":"https://api.github.com/users/256dpi/repos","events_url":"https://api.github.com/users/256dpi/events{/privacy}","received_events_url":"https://api.github.com/users/256dpi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-25T19:45:23Z","updated_at":"2015-08-30T12:27:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/gomqtt/message/pulls/5","html_url":"https://github.com/gomqtt/message/pull/5","diff_url":"https://github.com/gomqtt/message/pull/5.diff","patch_url":"https://github.com/gomqtt/message/pull/5.patch"},"body":"I added a basic fuzzing test with https://github.com/dvyukov/go-fuzz.\r\n\r\nBugs found so far:\r\n- [x] Unset `RemainingLength` when encoding a Disconnect message.\r\n- [ ] Slice bounds out of range: `header.go:224`\r\n- [ ] Slice bounds out of range: `publish.go:173`\r\n- [ ] Index out of range: `connect.go:488`\r\n- [ ] Index out of range: `connack.go:98`\r\n- [ ] Slice bounds out of range: `suback.go:98`\r\n- [ ] Index out of range: `subscribe.go:177`\r\n\r\nGoal is to run the fuzzing test for min. 2 hours without any errors."},"comment":{"url":"https://api.github.com/repos/gomqtt/message/issues/comments/136132151","html_url":"https://github.com/gomqtt/message/pull/5#issuecomment-136132151","issue_url":"https://api.github.com/repos/gomqtt/message/issues/5","id":136132151,"user":{"login":"256dpi","id":696886,"avatar_url":"https://avatars.githubusercontent.com/u/696886?v=3","gravatar_id":"","url":"https://api.github.com/users/256dpi","html_url":"https://github.com/256dpi","followers_url":"https://api.github.com/users/256dpi/followers","following_url":"https://api.github.com/users/256dpi/following{/other_user}","gists_url":"https://api.github.com/users/256dpi/gists{/gist_id}","starred_url":"https://api.github.com/users/256dpi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/256dpi/subscriptions","organizations_url":"https://api.github.com/users/256dpi/orgs","repos_url":"https://api.github.com/users/256dpi/repos","events_url":"https://api.github.com/users/256dpi/events{/privacy}","received_events_url":"https://api.github.com/users/256dpi/received_events","type":"User","site_admin":false},"created_at":"2015-08-30T12:27:05Z","updated_at":"2015-08-30T12:27:05Z","body":"Nah, I guess we have to check the length of the buffer before every access. I wonder if this could be abstracted a little bit, like:\r\n\r\n```go\r\nslice, err := buf.take(2)\r\n```\r\n\r\nOtherwise we end up with a lot of:\r\n\r\n```go\r\nif len(buf) < offset + 2 {\r\n  return fmt.Errorf(\"buffer to short...\")\r\n}\r\n```\r\n\r\nOr what do you think would be the proper go way?"}}