{"action":"closed","issue":{"url":"https://api.github.com/repos/angr/angr/issues/1157","repository_url":"https://api.github.com/repos/angr/angr","labels_url":"https://api.github.com/repos/angr/angr/issues/1157/labels{/name}","comments_url":"https://api.github.com/repos/angr/angr/issues/1157/comments","events_url":"https://api.github.com/repos/angr/angr/issues/1157/events","html_url":"https://github.com/angr/angr/issues/1157","id":345643337,"node_id":"MDU6SXNzdWUzNDU2NDMzMzc=","number":1157,"title":"False memory read on realloc passing NULL as a pointer","user":{"login":"mor619dx","id":7024240,"node_id":"MDQ6VXNlcjcwMjQyNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/7024240?v=4","gravatar_id":"","url":"https://api.github.com/users/mor619dx","html_url":"https://github.com/mor619dx","followers_url":"https://api.github.com/users/mor619dx/followers","following_url":"https://api.github.com/users/mor619dx/following{/other_user}","gists_url":"https://api.github.com/users/mor619dx/gists{/gist_id}","starred_url":"https://api.github.com/users/mor619dx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mor619dx/subscriptions","organizations_url":"https://api.github.com/users/mor619dx/orgs","repos_url":"https://api.github.com/users/mor619dx/repos","events_url":"https://api.github.com/users/mor619dx/events{/privacy}","received_events_url":"https://api.github.com/users/mor619dx/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-30T07:34:06Z","updated_at":"2018-07-30T08:01:21Z","closed_at":"2018-07-30T08:01:21Z","author_association":"CONTRIBUTOR","body":"Hello,\r\n\r\nI've found some different behavior on the realloc function usage and angr realloc implementation.\r\nAccording to https://en.cppreference.com/w/c/memory/realloc\r\n\r\n`If ptr is NULL, the behavior is the same as calling malloc(new_size).`\r\nSo in case realloc is being like so:\r\n```\r\nvoid realloc_null() {\r\n        int* p = realloc(NULL, 0x20);\r\n}\r\n```\r\n\r\nMemory breakpoint will happen on the address of 0 (NULL) although we shouldn't read from the buffer received.\r\n\r\nThis is the realloc implementation: https://github.com/angr/angr/blob/master/angr/procedures/libc/realloc.py\r\n\r\nI will create pull request fixing this issue."}}
{"actor":{"display_login":"mor619dx"}}