{"action":"created","issue":{"url":"https://api.github.com/repos/manastech/crystal/issues/700","labels_url":"https://api.github.com/repos/manastech/crystal/issues/700/labels{/name}","comments_url":"https://api.github.com/repos/manastech/crystal/issues/700/comments","events_url":"https://api.github.com/repos/manastech/crystal/issues/700/events","html_url":"https://github.com/manastech/crystal/issues/700","id":81335905,"number":700,"title":"Pointer without a value","user":{"login":"bararchy","id":1631073,"avatar_url":"https://avatars.githubusercontent.com/u/1631073?v=3","gravatar_id":"","url":"https://api.github.com/users/bararchy","html_url":"https://github.com/bararchy","followers_url":"https://api.github.com/users/bararchy/followers","following_url":"https://api.github.com/users/bararchy/following{/other_user}","gists_url":"https://api.github.com/users/bararchy/gists{/gist_id}","starred_url":"https://api.github.com/users/bararchy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bararchy/subscriptions","organizations_url":"https://api.github.com/users/bararchy/orgs","repos_url":"https://api.github.com/users/bararchy/repos","events_url":"https://api.github.com/users/bararchy/events{/privacy}","received_events_url":"https://api.github.com/users/bararchy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-27T07:57:27Z","updated_at":"2015-05-27T10:42:59Z","closed_at":null,"body":"Shouldn't that just return a false (or nil) ? \r\n```crystal\r\nptr = Pointer(String).malloc(5)\r\nputs ptr.value\r\nptr.value = \"Testing\"\r\nputs ptr.value\r\n```\r\noutput is : Program terminated abnormally with error code: 139\r\n\r\nexample : http://carc.in/#/r/l2\r\n\r\n\r\nreference : http://crystal-lang.org/api/Pointer.html\r\n\"Note that a pointer is falsey if it's null (if it's address is zero).\"\r\n"},"comment":{"url":"https://api.github.com/repos/manastech/crystal/issues/comments/105862322","html_url":"https://github.com/manastech/crystal/issues/700#issuecomment-105862322","issue_url":"https://api.github.com/repos/manastech/crystal/issues/700","id":105862322,"user":{"login":"jhass","id":141294,"avatar_url":"https://avatars.githubusercontent.com/u/141294?v=3","gravatar_id":"","url":"https://api.github.com/users/jhass","html_url":"https://github.com/jhass","followers_url":"https://api.github.com/users/jhass/followers","following_url":"https://api.github.com/users/jhass/following{/other_user}","gists_url":"https://api.github.com/users/jhass/gists{/gist_id}","starred_url":"https://api.github.com/users/jhass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhass/subscriptions","organizations_url":"https://api.github.com/users/jhass/orgs","repos_url":"https://api.github.com/users/jhass/repos","events_url":"https://api.github.com/users/jhass/events{/privacy}","received_events_url":"https://api.github.com/users/jhass/received_events","type":"User","site_admin":false},"created_at":"2015-05-27T10:42:59Z","updated_at":"2015-05-27T10:42:59Z","body":"Look at all the metadata that's setup when you make a string: https://github.com/manastech/crystal/blob/master/src/string.cr#L195\r\n\r\nIn your case all that data is set to a bunch of 0's, and 5 bytes is probably not even enough to fit it, so you get accesses to uninitialized memory."}}