{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/solidity/issues/2884","repository_url":"https://api.github.com/repos/ethereum/solidity","labels_url":"https://api.github.com/repos/ethereum/solidity/issues/2884/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/solidity/issues/2884/comments","events_url":"https://api.github.com/repos/ethereum/solidity/issues/2884/events","html_url":"https://github.com/ethereum/solidity/issues/2884","id":256883946,"node_id":"MDU6SXNzdWUyNTY4ODM5NDY=","number":2884,"title":"address.call(bytesVar) results in corrupted data in the call","user":{"login":"lastperson","id":6198746,"node_id":"MDQ6VXNlcjYxOTg3NDY=","avatar_url":"https://avatars0.githubusercontent.com/u/6198746?v=4","gravatar_id":"","url":"https://api.github.com/users/lastperson","html_url":"https://github.com/lastperson","followers_url":"https://api.github.com/users/lastperson/followers","following_url":"https://api.github.com/users/lastperson/following{/other_user}","gists_url":"https://api.github.com/users/lastperson/gists{/gist_id}","starred_url":"https://api.github.com/users/lastperson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lastperson/subscriptions","organizations_url":"https://api.github.com/users/lastperson/orgs","repos_url":"https://api.github.com/users/lastperson/repos","events_url":"https://api.github.com/users/lastperson/events{/privacy}","received_events_url":"https://api.github.com/users/lastperson/received_events","type":"User","site_admin":false},"labels":[{"id":249074435,"node_id":"MDU6TGFiZWwyNDkwNzQ0MzU=","url":"https://api.github.com/repos/ethereum/solidity/labels/bug%20:bug:","name":"bug :bug:","color":"fc1313","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2017-09-12T00:52:06Z","updated_at":"2018-08-01T15:18:52Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"If the `bytesVar` is a `bytes` param from a function call, then passing it to `address.call` will result in the input being zero padded to 32*n bytes.\r\n\r\nWhich version of Solidity you are using: 0.4.16 (reproducible on 0.3.5 too)\r\nWhat was the source code (if applicable):\r\n```\r\npragma solidity 0.4.16;\r\ncontract Caller {\r\n    Caller2 receiver;\r\n    function Caller(Caller2 _rec) {\r\n        receiver = _rec;\r\n    }\r\n    function forward() {\r\n        receiver.forward(msg.data);\r\n    }\r\n}\r\ncontract Caller2 {\r\n    event Debug(uint, bytes);\r\n    address receiver;\r\n    function Caller2(address _rec) {\r\n        receiver = _rec;\r\n    }\r\n    function forward(bytes _data) {\r\n        Debug(_data.length, _data);\r\n        receiver.call(_data);\r\n    }\r\n}\r\ncontract Receiever {\r\n    event DebugReceive(uint, bytes);\r\n    function () {\r\n        DebugReceive(msg.data.length, msg.data);\r\n    }\r\n}\r\n```\r\nWhich platform are you running on: Remix IDE\r\nHow to reproduce the issue(abstract code):\r\n```\r\nvar receiver = new Receiver();\r\nvar caller2 = new Caller2(receiver.address);\r\nvar caller = new Caller(caller2.address);\r\ncaller.forward();\r\n```\r\nWhat was the result of the issue(events emitted):\r\n```\r\nDebug(4, '0xd264e05e')\r\nDebugReceived(32, '0xd264e05e00000000000000000000000000000000000000000000000000000000')\r\n```\r\nWhat the expected behavior is:\r\n```\r\nDebug(4, '0xd264e05e')\r\nDebugReceived(4, '0xd264e05e')\r\n```\r\nExample in mainnet https://etherscan.io/tx/0x994098c4d8166baa361729b48470b44e700bf4ccfb214ebc81cf872dc3d64d15 (check Parity trace)\r\n\r\nContract that cannot receive calls from multisigs due to this bug:\r\nhttps://etherscan.io/address/0x1776e1f26f98b1a5df9cd347953a26dd3cb46671#code\r\n\r\nCode that fails to process corrupted calls:\r\n```\r\n    // mitigate short address attack\r\n    modifier onlyPayloadSize(uint numWords) {\r\n        assert(msg.data.length == numWords * 32 + 4);\r\n        _;\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/ethereum/solidity/issues/comments/409612434","html_url":"https://github.com/ethereum/solidity/issues/2884#issuecomment-409612434","issue_url":"https://api.github.com/repos/ethereum/solidity/issues/2884","id":409612434,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTYxMjQzNA==","user":{"login":"chriseth","id":9073706,"node_id":"MDQ6VXNlcjkwNzM3MDY=","avatar_url":"https://avatars2.githubusercontent.com/u/9073706?v=4","gravatar_id":"","url":"https://api.github.com/users/chriseth","html_url":"https://github.com/chriseth","followers_url":"https://api.github.com/users/chriseth/followers","following_url":"https://api.github.com/users/chriseth/following{/other_user}","gists_url":"https://api.github.com/users/chriseth/gists{/gist_id}","starred_url":"https://api.github.com/users/chriseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriseth/subscriptions","organizations_url":"https://api.github.com/users/chriseth/orgs","repos_url":"https://api.github.com/users/chriseth/repos","events_url":"https://api.github.com/users/chriseth/events{/privacy}","received_events_url":"https://api.github.com/users/chriseth/received_events","type":"User","site_admin":false},"created_at":"2018-08-01T15:18:52Z","updated_at":"2018-08-01T15:18:52Z","author_association":"CONTRIBUTOR","body":"Yes!"}}
{"actor":{"display_login":"chriseth"}}