{"action":"created","comment":{"url":"https://api.github.com/repos/golang/snappy/pulls/comments/35741737","id":35741737,"diff_hunk":"@@ -27,12 +29,16 @@ func DecodedLen(src []byte) (int, error) {\n // that the length header occupied.\n func decodedLen(src []byte) (blockLen, headerLen int, err error) {\n \tv, n := binary.Uvarint(src)\n-\tif n <= 0 {\n+\tif n <= 0 || v > 0xffffffff {\n \t\treturn 0, 0, ErrCorrupt\n \t}\n-\tif uint64(int(v)) != v {\n-\t\treturn 0, 0, errors.New(\"snappy: decoded block is too large\")\n+\n+\tconst wordsize = 32 << (^uint(0) >> 32 & 1)\n+","path":"decode.go","position":21,"original_position":21,"commit_id":"8c5d6e570fb6777e27854ba82b50aa59d44b437c","original_commit_id":"8c5d6e570fb6777e27854ba82b50aa59d44b437c","user":{"login":"nigeltao","id":8565232,"avatar_url":"https://avatars.githubusercontent.com/u/8565232?v=3","gravatar_id":"","url":"https://api.github.com/users/nigeltao","html_url":"https://github.com/nigeltao","followers_url":"https://api.github.com/users/nigeltao/followers","following_url":"https://api.github.com/users/nigeltao/following{/other_user}","gists_url":"https://api.github.com/users/nigeltao/gists{/gist_id}","starred_url":"https://api.github.com/users/nigeltao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nigeltao/subscriptions","organizations_url":"https://api.github.com/users/nigeltao/orgs","repos_url":"https://api.github.com/users/nigeltao/repos","events_url":"https://api.github.com/users/nigeltao/events{/privacy}","received_events_url":"https://api.github.com/users/nigeltao/received_events","type":"User","site_admin":false},"body":"Delete the blank line.","created_at":"2015-07-29T09:28:15Z","updated_at":"2015-07-29T09:28:15Z","html_url":"https://github.com/golang/snappy/pull/16#discussion_r35741737","pull_request_url":"https://api.github.com/repos/golang/snappy/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/golang/snappy/pulls/comments/35741737"},"html":{"href":"https://github.com/golang/snappy/pull/16#discussion_r35741737"},"pull_request":{"href":"https://api.github.com/repos/golang/snappy/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/golang/snappy/pulls/16","id":40428184,"html_url":"https://github.com/golang/snappy/pull/16","diff_url":"https://github.com/golang/snappy/pull/16.diff","patch_url":"https://github.com/golang/snappy/pull/16.patch","issue_url":"https://api.github.com/repos/golang/snappy/issues/16","number":16,"state":"open","locked":false,"title":"Fix max block size check","user":{"login":"dgryski","id":970862,"avatar_url":"https://avatars.githubusercontent.com/u/970862?v=3","gravatar_id":"","url":"https://api.github.com/users/dgryski","html_url":"https://github.com/dgryski","followers_url":"https://api.github.com/users/dgryski/followers","following_url":"https://api.github.com/users/dgryski/following{/other_user}","gists_url":"https://api.github.com/users/dgryski/gists{/gist_id}","starred_url":"https://api.github.com/users/dgryski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgryski/subscriptions","organizations_url":"https://api.github.com/users/dgryski/orgs","repos_url":"https://api.github.com/users/dgryski/repos","events_url":"https://api.github.com/users/dgryski/events{/privacy}","received_events_url":"https://api.github.com/users/dgryski/received_events","type":"User","site_admin":false},"body":"Since Go 1.1, `int` has been 64-bits on 64-bit platforms instead of\n32-bits.  This patch fixes the check to make sure the uncompressed\nlength is at most 2^32-1 bytes.\n\nFixes #15","created_at":"2015-07-21T07:06:30Z","updated_at":"2015-07-29T09:28:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f8e9e707a6ac3724930d8069906951eec754bae","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/golang/snappy/pulls/16/commits","review_comments_url":"https://api.github.com/repos/golang/snappy/pulls/16/comments","review_comment_url":"https://api.github.com/repos/golang/snappy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/golang/snappy/issues/16/comments","statuses_url":"https://api.github.com/repos/golang/snappy/statuses/8c5d6e570fb6777e27854ba82b50aa59d44b437c","head":{"label":"dgryski:uint32-fix","ref":"uint32-fix","sha":"8c5d6e570fb6777e27854ba82b50aa59d44b437c","user":{"login":"dgryski","id":970862,"avatar_url":"https://avatars.githubusercontent.com/u/970862?v=3","gravatar_id":"","url":"https://api.github.com/users/dgryski","html_url":"https://github.com/dgryski","followers_url":"https://api.github.com/users/dgryski/followers","following_url":"https://api.github.com/users/dgryski/following{/other_user}","gists_url":"https://api.github.com/users/dgryski/gists{/gist_id}","starred_url":"https://api.github.com/users/dgryski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgryski/subscriptions","organizations_url":"https://api.github.com/users/dgryski/orgs","repos_url":"https://api.github.com/users/dgryski/repos","events_url":"https://api.github.com/users/dgryski/events{/privacy}","received_events_url":"https://api.github.com/users/dgryski/received_events","type":"User","site_admin":false},"repo":{"id":39429203,"name":"snappy","full_name":"dgryski/snappy","owner":{"login":"dgryski","id":970862,"avatar_url":"https://avatars.githubusercontent.com/u/970862?v=3","gravatar_id":"","url":"https://api.github.com/users/dgryski","html_url":"https://github.com/dgryski","followers_url":"https://api.github.com/users/dgryski/followers","following_url":"https://api.github.com/users/dgryski/following{/other_user}","gists_url":"https://api.github.com/users/dgryski/gists{/gist_id}","starred_url":"https://api.github.com/users/dgryski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgryski/subscriptions","organizations_url":"https://api.github.com/users/dgryski/orgs","repos_url":"https://api.github.com/users/dgryski/repos","events_url":"https://api.github.com/users/dgryski/events{/privacy}","received_events_url":"https://api.github.com/users/dgryski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dgryski/snappy","description":"The Snappy compression format in the Go programming language.","fork":true,"url":"https://api.github.com/repos/dgryski/snappy","forks_url":"https://api.github.com/repos/dgryski/snappy/forks","keys_url":"https://api.github.com/repos/dgryski/snappy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dgryski/snappy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dgryski/snappy/teams","hooks_url":"https://api.github.com/repos/dgryski/snappy/hooks","issue_events_url":"https://api.github.com/repos/dgryski/snappy/issues/events{/number}","events_url":"https://api.github.com/repos/dgryski/snappy/events","assignees_url":"https://api.github.com/repos/dgryski/snappy/assignees{/user}","branches_url":"https://api.github.com/repos/dgryski/snappy/branches{/branch}","tags_url":"https://api.github.com/repos/dgryski/snappy/tags","blobs_url":"https://api.github.com/repos/dgryski/snappy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dgryski/snappy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dgryski/snappy/git/refs{/sha}","trees_url":"https://api.github.com/repos/dgryski/snappy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dgryski/snappy/statuses/{sha}","languages_url":"https://api.github.com/repos/dgryski/snappy/languages","stargazers_url":"https://api.github.com/repos/dgryski/snappy/stargazers","contributors_url":"https://api.github.com/repos/dgryski/snappy/contributors","subscribers_url":"https://api.github.com/repos/dgryski/snappy/subscribers","subscription_url":"https://api.github.com/repos/dgryski/snappy/subscription","commits_url":"https://api.github.com/repos/dgryski/snappy/commits{/sha}","git_commits_url":"https://api.github.com/repos/dgryski/snappy/git/commits{/sha}","comments_url":"https://api.github.com/repos/dgryski/snappy/comments{/number}","issue_comment_url":"https://api.github.com/repos/dgryski/snappy/issues/comments{/number}","contents_url":"https://api.github.com/repos/dgryski/snappy/contents/{+path}","compare_url":"https://api.github.com/repos/dgryski/snappy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dgryski/snappy/merges","archive_url":"https://api.github.com/repos/dgryski/snappy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dgryski/snappy/downloads","issues_url":"https://api.github.com/repos/dgryski/snappy/issues{/number}","pulls_url":"https://api.github.com/repos/dgryski/snappy/pulls{/number}","milestones_url":"https://api.github.com/repos/dgryski/snappy/milestones{/number}","notifications_url":"https://api.github.com/repos/dgryski/snappy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dgryski/snappy/labels{/name}","releases_url":"https://api.github.com/repos/dgryski/snappy/releases{/id}","created_at":"2015-07-21T06:51:22Z","updated_at":"2015-07-21T06:51:23Z","pushed_at":"2015-07-28T07:18:43Z","git_url":"git://github.com/dgryski/snappy.git","ssh_url":"git@github.com:dgryski/snappy.git","clone_url":"https://github.com/dgryski/snappy.git","svn_url":"https://github.com/dgryski/snappy","homepage":"","size":135,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"golang:master","ref":"master","sha":"0c7f8a7704bfec561913f4df52c832f094ef56f0","user":{"login":"golang","id":4314092,"avatar_url":"https://avatars.githubusercontent.com/u/4314092?v=3","gravatar_id":"","url":"https://api.github.com/users/golang","html_url":"https://github.com/golang","followers_url":"https://api.github.com/users/golang/followers","following_url":"https://api.github.com/users/golang/following{/other_user}","gists_url":"https://api.github.com/users/golang/gists{/gist_id}","starred_url":"https://api.github.com/users/golang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/golang/subscriptions","organizations_url":"https://api.github.com/users/golang/orgs","repos_url":"https://api.github.com/users/golang/repos","events_url":"https://api.github.com/users/golang/events{/privacy}","received_events_url":"https://api.github.com/users/golang/received_events","type":"Organization","site_admin":false},"repo":{"id":35516397,"name":"snappy","full_name":"golang/snappy","owner":{"login":"golang","id":4314092,"avatar_url":"https://avatars.githubusercontent.com/u/4314092?v=3","gravatar_id":"","url":"https://api.github.com/users/golang","html_url":"https://github.com/golang","followers_url":"https://api.github.com/users/golang/followers","following_url":"https://api.github.com/users/golang/following{/other_user}","gists_url":"https://api.github.com/users/golang/gists{/gist_id}","starred_url":"https://api.github.com/users/golang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/golang/subscriptions","organizations_url":"https://api.github.com/users/golang/orgs","repos_url":"https://api.github.com/users/golang/repos","events_url":"https://api.github.com/users/golang/events{/privacy}","received_events_url":"https://api.github.com/users/golang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/golang/snappy","description":"The Snappy compression format in the Go programming language.","fork":false,"url":"https://api.github.com/repos/golang/snappy","forks_url":"https://api.github.com/repos/golang/snappy/forks","keys_url":"https://api.github.com/repos/golang/snappy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/golang/snappy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/golang/snappy/teams","hooks_url":"https://api.github.com/repos/golang/snappy/hooks","issue_events_url":"https://api.github.com/repos/golang/snappy/issues/events{/number}","events_url":"https://api.github.com/repos/golang/snappy/events","assignees_url":"https://api.github.com/repos/golang/snappy/assignees{/user}","branches_url":"https://api.github.com/repos/golang/snappy/branches{/branch}","tags_url":"https://api.github.com/repos/golang/snappy/tags","blobs_url":"https://api.github.com/repos/golang/snappy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/golang/snappy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/golang/snappy/git/refs{/sha}","trees_url":"https://api.github.com/repos/golang/snappy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/golang/snappy/statuses/{sha}","languages_url":"https://api.github.com/repos/golang/snappy/languages","stargazers_url":"https://api.github.com/repos/golang/snappy/stargazers","contributors_url":"https://api.github.com/repos/golang/snappy/contributors","subscribers_url":"https://api.github.com/repos/golang/snappy/subscribers","subscription_url":"https://api.github.com/repos/golang/snappy/subscription","commits_url":"https://api.github.com/repos/golang/snappy/commits{/sha}","git_commits_url":"https://api.github.com/repos/golang/snappy/git/commits{/sha}","comments_url":"https://api.github.com/repos/golang/snappy/comments{/number}","issue_comment_url":"https://api.github.com/repos/golang/snappy/issues/comments{/number}","contents_url":"https://api.github.com/repos/golang/snappy/contents/{+path}","compare_url":"https://api.github.com/repos/golang/snappy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/golang/snappy/merges","archive_url":"https://api.github.com/repos/golang/snappy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/golang/snappy/downloads","issues_url":"https://api.github.com/repos/golang/snappy/issues{/number}","pulls_url":"https://api.github.com/repos/golang/snappy/pulls{/number}","milestones_url":"https://api.github.com/repos/golang/snappy/milestones{/number}","notifications_url":"https://api.github.com/repos/golang/snappy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/golang/snappy/labels{/name}","releases_url":"https://api.github.com/repos/golang/snappy/releases{/id}","created_at":"2015-05-12T22:48:31Z","updated_at":"2015-07-28T13:35:27Z","pushed_at":"2015-07-28T07:18:44Z","git_url":"git://github.com/golang/snappy.git","ssh_url":"git@github.com:golang/snappy.git","clone_url":"https://github.com/golang/snappy.git","svn_url":"https://github.com/golang/snappy","homepage":"","size":282,"stargazers_count":55,"watchers_count":55,"language":"Go","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":2,"forks":7,"open_issues":2,"watchers":55,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/golang/snappy/pulls/16"},"html":{"href":"https://github.com/golang/snappy/pull/16"},"issue":{"href":"https://api.github.com/repos/golang/snappy/issues/16"},"comments":{"href":"https://api.github.com/repos/golang/snappy/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/golang/snappy/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/golang/snappy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/golang/snappy/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/golang/snappy/statuses/8c5d6e570fb6777e27854ba82b50aa59d44b437c"}}}}