{"action":"created","issue":{"url":"https://api.github.com/repos/feross/webtorrent/issues/820","repository_url":"https://api.github.com/repos/feross/webtorrent","labels_url":"https://api.github.com/repos/feross/webtorrent/issues/820/labels{/name}","comments_url":"https://api.github.com/repos/feross/webtorrent/issues/820/comments","events_url":"https://api.github.com/repos/feross/webtorrent/issues/820/events","html_url":"https://github.com/feross/webtorrent/issues/820","id":157363781,"number":820,"title":"Attempt to write outside buffer bounds","user":{"login":"jimmywarting","id":1148376,"avatar_url":"https://avatars.githubusercontent.com/u/1148376?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmywarting","html_url":"https://github.com/jimmywarting","followers_url":"https://api.github.com/users/jimmywarting/followers","following_url":"https://api.github.com/users/jimmywarting/following{/other_user}","gists_url":"https://api.github.com/users/jimmywarting/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmywarting/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmywarting/subscriptions","organizations_url":"https://api.github.com/users/jimmywarting/orgs","repos_url":"https://api.github.com/users/jimmywarting/repos","events_url":"https://api.github.com/users/jimmywarting/events{/privacy}","received_events_url":"https://api.github.com/users/jimmywarting/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/feross/webtorrent/labels/need%20more%20info","name":"need more info","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-29T01:03:21Z","updated_at":"2016-05-30T02:07:01Z","closed_at":"2016-05-29T11:09:18Z","body":"<!-- Issue with the desktop app? Those go here: https://github.com/feross/webtorrent-desktop/issues -->\r\n\r\n* WebTorrent version: 1.2.2 (webtorrent 0.94.2)\r\n* Node.js version: v6.2.0\r\n\r\n```\r\nUNEXPECTED ERROR: If this is a bug in WebTorrent, report it!\r\nOPEN AN ISSUE: https://github.com/feross/webtorrent/issues\r\n\r\nbuffer.js:772\r\n    throw new RangeError('Attempt to write outside buffer bounds');\r\n    ^\r\n\r\nRangeError: Attempt to write outside buffer bounds\r\n    at Buffer.write (buffer.js:772:11)\r\n    at fromString (buffer.js:238:26)\r\n    at Function.Buffer.from (buffer.js:131:12)\r\n    at new Buffer (buffer.js:112:17)\r\n    at Function.encode.buffer (../webtorrent-cli/node_modules/bencode/lib/encode.js:61:17)\r\n    at Function.encode.dict (../webtorrent-cli/node_modules/bencode/lib/encode.js:95:12)\r\n    at Function.encode._encode (../webtorrent-cli/node_modules/bencode/lib/encode.js:46:18)\r\n    at Object.encode (../webtorrent-cli/node_modules/bencode/lib/encode.js:12:10)\r\n    at Wire._sendExtendedHandshake (../webtorrent-cli/node_modules/bittorrent-protocol/index.js:243:28)\r\n    at Wire._onHandshake (../webtorrent-cli/node_modules/bittorrent-protocol/index.js:444:10)\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/feross/webtorrent/issues/comments/222398399","html_url":"https://github.com/feross/webtorrent/issues/820#issuecomment-222398399","issue_url":"https://api.github.com/repos/feross/webtorrent/issues/820","id":222398399,"user":{"login":"feross","id":121766,"avatar_url":"https://avatars.githubusercontent.com/u/121766?v=3","gravatar_id":"","url":"https://api.github.com/users/feross","html_url":"https://github.com/feross","followers_url":"https://api.github.com/users/feross/followers","following_url":"https://api.github.com/users/feross/following{/other_user}","gists_url":"https://api.github.com/users/feross/gists{/gist_id}","starred_url":"https://api.github.com/users/feross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feross/subscriptions","organizations_url":"https://api.github.com/users/feross/orgs","repos_url":"https://api.github.com/users/feross/repos","events_url":"https://api.github.com/users/feross/events{/privacy}","received_events_url":"https://api.github.com/users/feross/received_events","type":"User","site_admin":false},"created_at":"2016-05-30T02:07:01Z","updated_at":"2016-05-30T02:07:01Z","body":"This is definitely still a bug.\r\n\r\nIt's caused by two issues that together cause this behavior:\r\n\r\n1. We're passing in a negative value to the `Buffer` constructor.\r\n\r\n2. Node.js has a bug when you call the `Buffer` constructor with a negative value that messes up some internal state and causes later `Buffer` allocations to be buggy! See https://github.com/nodejs/node/issues/7047#issuecomment-222393982 Pretty bad bug, IMO.\r\n\r\nNode.js will fix the issue in a future release. We should validate user data better so that we're not accepting whatever random numbers the user gives us.\r\n\r\nGoing to re-open this issue to track progress toward that goal."}}
{"actor":{"display_login":"feross"}}