{"action":"created","comment":{"url":"https://api.github.com/repos/btcsuite/btcd/pulls/comments/41158131","id":41158131,"diff_hunk":"@@ -165,10 +164,10 @@ func (n scriptNum) Int32() int32 {\n // requireMinimal enabled.\n //\n // See the Bytes function documentation for example encodings.\n-func makeScriptNum(v []byte, requireMinimal bool) (scriptNum, error) {\n-\t// Interpreting data as an integer requires that it is not larger than\n-\t// a 32-bit integer.\n-\tif len(v) > maxScriptNumLen {\n+func makeScriptNum(v []byte, requireMinimal bool, scriptNumLen int) (scriptNum, error) {\n+\t// Interpreting data requires that it is not larger than\n+\t// the maximum scriptnum length or the passed scriptNumLen value.\n+\tif scriptNumLen > maxScriptNumLen || len(v) > scriptNumLen {","path":"txscript/scriptnum.go","position":40,"original_position":40,"commit_id":"f512063df74936dccab523190535df267b630b96","original_commit_id":"f512063df74936dccab523190535df267b630b96","user":{"login":"davecgh","id":2115102,"avatar_url":"https://avatars.githubusercontent.com/u/2115102?v=3","gravatar_id":"","url":"https://api.github.com/users/davecgh","html_url":"https://github.com/davecgh","followers_url":"https://api.github.com/users/davecgh/followers","following_url":"https://api.github.com/users/davecgh/following{/other_user}","gists_url":"https://api.github.com/users/davecgh/gists{/gist_id}","starred_url":"https://api.github.com/users/davecgh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davecgh/subscriptions","organizations_url":"https://api.github.com/users/davecgh/orgs","repos_url":"https://api.github.com/users/davecgh/repos","events_url":"https://api.github.com/users/davecgh/events{/privacy}","received_events_url":"https://api.github.com/users/davecgh/received_events","type":"User","site_admin":false},"body":"The initial check against 9 can't be here.  While I agree with you that anything large than that number would cause an overflow and therefore should be invalidated, it can't be because that would disagree with the consensus rules.","created_at":"2015-10-05T15:32:50Z","updated_at":"2015-10-05T15:32:50Z","html_url":"https://github.com/btcsuite/btcd/pull/455#discussion_r41158131","pull_request_url":"https://api.github.com/repos/btcsuite/btcd/pulls/455","_links":{"self":{"href":"https://api.github.com/repos/btcsuite/btcd/pulls/comments/41158131"},"html":{"href":"https://github.com/btcsuite/btcd/pull/455#discussion_r41158131"},"pull_request":{"href":"https://api.github.com/repos/btcsuite/btcd/pulls/455"}}},"pull_request":{"url":"https://api.github.com/repos/btcsuite/btcd/pulls/455","id":38665876,"html_url":"https://github.com/btcsuite/btcd/pull/455","diff_url":"https://github.com/btcsuite/btcd/pull/455.diff","patch_url":"https://github.com/btcsuite/btcd/pull/455.patch","issue_url":"https://api.github.com/repos/btcsuite/btcd/issues/455","number":455,"state":"open","locked":false,"title":"txscript: Change makeScriptNum take a length argument","user":{"login":"dajohi","id":3308193,"avatar_url":"https://avatars.githubusercontent.com/u/3308193?v=3","gravatar_id":"","url":"https://api.github.com/users/dajohi","html_url":"https://github.com/dajohi","followers_url":"https://api.github.com/users/dajohi/followers","following_url":"https://api.github.com/users/dajohi/following{/other_user}","gists_url":"https://api.github.com/users/dajohi/gists{/gist_id}","starred_url":"https://api.github.com/users/dajohi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dajohi/subscriptions","organizations_url":"https://api.github.com/users/dajohi/orgs","repos_url":"https://api.github.com/users/dajohi/repos","events_url":"https://api.github.com/users/dajohi/events{/privacy}","received_events_url":"https://api.github.com/users/dajohi/received_events","type":"User","site_admin":false},"body":"While current existing numeric opcodes are limited to 4 bytes, new\r\nopcodes may need different limits.\r\n\r\nThis mimics Bitcoin Core commit 99088d60d8a7747c6d1a7fd5d8cd388be1b3e138","created_at":"2015-06-26T16:24:51Z","updated_at":"2015-10-05T15:32:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d6f45c9278c980dcca4caf3d99ad78681d9bb57","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/btcsuite/btcd/pulls/455/commits","review_comments_url":"https://api.github.com/repos/btcsuite/btcd/pulls/455/comments","review_comment_url":"https://api.github.com/repos/btcsuite/btcd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/btcsuite/btcd/issues/455/comments","statuses_url":"https://api.github.com/repos/btcsuite/btcd/statuses/f512063df74936dccab523190535df267b630b96","head":{"label":"dajohi:scriptnum","ref":"scriptnum","sha":"f512063df74936dccab523190535df267b630b96","user":{"login":"dajohi","id":3308193,"avatar_url":"https://avatars.githubusercontent.com/u/3308193?v=3","gravatar_id":"","url":"https://api.github.com/users/dajohi","html_url":"https://github.com/dajohi","followers_url":"https://api.github.com/users/dajohi/followers","following_url":"https://api.github.com/users/dajohi/following{/other_user}","gists_url":"https://api.github.com/users/dajohi/gists{/gist_id}","starred_url":"https://api.github.com/users/dajohi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dajohi/subscriptions","organizations_url":"https://api.github.com/users/dajohi/orgs","repos_url":"https://api.github.com/users/dajohi/repos","events_url":"https://api.github.com/users/dajohi/events{/privacy}","received_events_url":"https://api.github.com/users/dajohi/received_events","type":"User","site_admin":false},"repo":{"id":30096355,"name":"btcd","full_name":"dajohi/btcd","owner":{"login":"dajohi","id":3308193,"avatar_url":"https://avatars.githubusercontent.com/u/3308193?v=3","gravatar_id":"","url":"https://api.github.com/users/dajohi","html_url":"https://github.com/dajohi","followers_url":"https://api.github.com/users/dajohi/followers","following_url":"https://api.github.com/users/dajohi/following{/other_user}","gists_url":"https://api.github.com/users/dajohi/gists{/gist_id}","starred_url":"https://api.github.com/users/dajohi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dajohi/subscriptions","organizations_url":"https://api.github.com/users/dajohi/orgs","repos_url":"https://api.github.com/users/dajohi/repos","events_url":"https://api.github.com/users/dajohi/events{/privacy}","received_events_url":"https://api.github.com/users/dajohi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dajohi/btcd","description":"An alternative full node bitcoin implementation written in Go (golang)","fork":true,"url":"https://api.github.com/repos/dajohi/btcd","forks_url":"https://api.github.com/repos/dajohi/btcd/forks","keys_url":"https://api.github.com/repos/dajohi/btcd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dajohi/btcd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dajohi/btcd/teams","hooks_url":"https://api.github.com/repos/dajohi/btcd/hooks","issue_events_url":"https://api.github.com/repos/dajohi/btcd/issues/events{/number}","events_url":"https://api.github.com/repos/dajohi/btcd/events","assignees_url":"https://api.github.com/repos/dajohi/btcd/assignees{/user}","branches_url":"https://api.github.com/repos/dajohi/btcd/branches{/branch}","tags_url":"https://api.github.com/repos/dajohi/btcd/tags","blobs_url":"https://api.github.com/repos/dajohi/btcd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dajohi/btcd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dajohi/btcd/git/refs{/sha}","trees_url":"https://api.github.com/repos/dajohi/btcd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dajohi/btcd/statuses/{sha}","languages_url":"https://api.github.com/repos/dajohi/btcd/languages","stargazers_url":"https://api.github.com/repos/dajohi/btcd/stargazers","contributors_url":"https://api.github.com/repos/dajohi/btcd/contributors","subscribers_url":"https://api.github.com/repos/dajohi/btcd/subscribers","subscription_url":"https://api.github.com/repos/dajohi/btcd/subscription","commits_url":"https://api.github.com/repos/dajohi/btcd/commits{/sha}","git_commits_url":"https://api.github.com/repos/dajohi/btcd/git/commits{/sha}","comments_url":"https://api.github.com/repos/dajohi/btcd/comments{/number}","issue_comment_url":"https://api.github.com/repos/dajohi/btcd/issues/comments{/number}","contents_url":"https://api.github.com/repos/dajohi/btcd/contents/{+path}","compare_url":"https://api.github.com/repos/dajohi/btcd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dajohi/btcd/merges","archive_url":"https://api.github.com/repos/dajohi/btcd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dajohi/btcd/downloads","issues_url":"https://api.github.com/repos/dajohi/btcd/issues{/number}","pulls_url":"https://api.github.com/repos/dajohi/btcd/pulls{/number}","milestones_url":"https://api.github.com/repos/dajohi/btcd/milestones{/number}","notifications_url":"https://api.github.com/repos/dajohi/btcd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dajohi/btcd/labels{/name}","releases_url":"https://api.github.com/repos/dajohi/btcd/releases{/id}","created_at":"2015-01-31T00:00:38Z","updated_at":"2015-03-19T19:14:12Z","pushed_at":"2015-09-28T20:25:49Z","git_url":"git://github.com/dajohi/btcd.git","ssh_url":"git@github.com:dajohi/btcd.git","clone_url":"https://github.com/dajohi/btcd.git","svn_url":"https://github.com/dajohi/btcd","homepage":null,"size":9357,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"btcsuite:master","ref":"master","sha":"03d423cebfe6e31a500f1f858d7998acae5a46ad","user":{"login":"btcsuite","id":10235229,"avatar_url":"https://avatars.githubusercontent.com/u/10235229?v=3","gravatar_id":"","url":"https://api.github.com/users/btcsuite","html_url":"https://github.com/btcsuite","followers_url":"https://api.github.com/users/btcsuite/followers","following_url":"https://api.github.com/users/btcsuite/following{/other_user}","gists_url":"https://api.github.com/users/btcsuite/gists{/gist_id}","starred_url":"https://api.github.com/users/btcsuite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btcsuite/subscriptions","organizations_url":"https://api.github.com/users/btcsuite/orgs","repos_url":"https://api.github.com/users/btcsuite/repos","events_url":"https://api.github.com/users/btcsuite/events{/privacy}","received_events_url":"https://api.github.com/users/btcsuite/received_events","type":"Organization","site_admin":false},"repo":{"id":11931032,"name":"btcd","full_name":"btcsuite/btcd","owner":{"login":"btcsuite","id":10235229,"avatar_url":"https://avatars.githubusercontent.com/u/10235229?v=3","gravatar_id":"","url":"https://api.github.com/users/btcsuite","html_url":"https://github.com/btcsuite","followers_url":"https://api.github.com/users/btcsuite/followers","following_url":"https://api.github.com/users/btcsuite/following{/other_user}","gists_url":"https://api.github.com/users/btcsuite/gists{/gist_id}","starred_url":"https://api.github.com/users/btcsuite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btcsuite/subscriptions","organizations_url":"https://api.github.com/users/btcsuite/orgs","repos_url":"https://api.github.com/users/btcsuite/repos","events_url":"https://api.github.com/users/btcsuite/events{/privacy}","received_events_url":"https://api.github.com/users/btcsuite/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/btcsuite/btcd","description":"An alternative full node bitcoin implementation written in Go (golang)","fork":false,"url":"https://api.github.com/repos/btcsuite/btcd","forks_url":"https://api.github.com/repos/btcsuite/btcd/forks","keys_url":"https://api.github.com/repos/btcsuite/btcd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/btcsuite/btcd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/btcsuite/btcd/teams","hooks_url":"https://api.github.com/repos/btcsuite/btcd/hooks","issue_events_url":"https://api.github.com/repos/btcsuite/btcd/issues/events{/number}","events_url":"https://api.github.com/repos/btcsuite/btcd/events","assignees_url":"https://api.github.com/repos/btcsuite/btcd/assignees{/user}","branches_url":"https://api.github.com/repos/btcsuite/btcd/branches{/branch}","tags_url":"https://api.github.com/repos/btcsuite/btcd/tags","blobs_url":"https://api.github.com/repos/btcsuite/btcd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/btcsuite/btcd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/btcsuite/btcd/git/refs{/sha}","trees_url":"https://api.github.com/repos/btcsuite/btcd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/btcsuite/btcd/statuses/{sha}","languages_url":"https://api.github.com/repos/btcsuite/btcd/languages","stargazers_url":"https://api.github.com/repos/btcsuite/btcd/stargazers","contributors_url":"https://api.github.com/repos/btcsuite/btcd/contributors","subscribers_url":"https://api.github.com/repos/btcsuite/btcd/subscribers","subscription_url":"https://api.github.com/repos/btcsuite/btcd/subscription","commits_url":"https://api.github.com/repos/btcsuite/btcd/commits{/sha}","git_commits_url":"https://api.github.com/repos/btcsuite/btcd/git/commits{/sha}","comments_url":"https://api.github.com/repos/btcsuite/btcd/comments{/number}","issue_comment_url":"https://api.github.com/repos/btcsuite/btcd/issues/comments{/number}","contents_url":"https://api.github.com/repos/btcsuite/btcd/contents/{+path}","compare_url":"https://api.github.com/repos/btcsuite/btcd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/btcsuite/btcd/merges","archive_url":"https://api.github.com/repos/btcsuite/btcd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/btcsuite/btcd/downloads","issues_url":"https://api.github.com/repos/btcsuite/btcd/issues{/number}","pulls_url":"https://api.github.com/repos/btcsuite/btcd/pulls{/number}","milestones_url":"https://api.github.com/repos/btcsuite/btcd/milestones{/number}","notifications_url":"https://api.github.com/repos/btcsuite/btcd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/btcsuite/btcd/labels{/name}","releases_url":"https://api.github.com/repos/btcsuite/btcd/releases{/id}","created_at":"2013-08-06T18:10:52Z","updated_at":"2015-10-05T15:26:12Z","pushed_at":"2015-10-04T22:33:13Z","git_url":"git://github.com/btcsuite/btcd.git","ssh_url":"git@github.com:btcsuite/btcd.git","clone_url":"https://github.com/btcsuite/btcd.git","svn_url":"https://github.com/btcsuite/btcd","homepage":"https://github.com/btcsuite/btcd/blob/master/docs/README.md","size":19899,"stargazers_count":690,"watchers_count":690,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":146,"mirror_url":null,"open_issues_count":51,"forks":146,"open_issues":51,"watchers":690,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/btcsuite/btcd/pulls/455"},"html":{"href":"https://github.com/btcsuite/btcd/pull/455"},"issue":{"href":"https://api.github.com/repos/btcsuite/btcd/issues/455"},"comments":{"href":"https://api.github.com/repos/btcsuite/btcd/issues/455/comments"},"review_comments":{"href":"https://api.github.com/repos/btcsuite/btcd/pulls/455/comments"},"review_comment":{"href":"https://api.github.com/repos/btcsuite/btcd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/btcsuite/btcd/pulls/455/commits"},"statuses":{"href":"https://api.github.com/repos/btcsuite/btcd/statuses/f512063df74936dccab523190535df267b630b96"}}}}