{"action":"created","issue":{"url":"https://api.github.com/repos/BurntSushi/xgb/issues/20","repository_url":"https://api.github.com/repos/BurntSushi/xgb","labels_url":"https://api.github.com/repos/BurntSushi/xgb/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/BurntSushi/xgb/issues/20/comments","events_url":"https://api.github.com/repos/BurntSushi/xgb/issues/20/events","html_url":"https://github.com/BurntSushi/xgb/issues/20","id":24915209,"number":20,"title":"Randr's GetScreenInfo  broken.","user":{"login":"snyh","id":1437166,"avatar_url":"https://avatars.githubusercontent.com/u/1437166?v=3","gravatar_id":"","url":"https://api.github.com/users/snyh","html_url":"https://github.com/snyh","followers_url":"https://api.github.com/users/snyh/followers","following_url":"https://api.github.com/users/snyh/following{/other_user}","gists_url":"https://api.github.com/users/snyh/gists{/gist_id}","starred_url":"https://api.github.com/users/snyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snyh/subscriptions","organizations_url":"https://api.github.com/users/snyh/orgs","repos_url":"https://api.github.com/users/snyh/repos","events_url":"https://api.github.com/users/snyh/events{/privacy}","received_events_url":"https://api.github.com/users/snyh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2013-12-31T08:56:31Z","updated_at":"2016-02-17T00:54:58Z","closed_at":null,"body":"It seems an xserver bug. \r\n\r\nAlthough only tested under xgb and xpyb,  but xserver didn't send the *rates* field of *GetScreenInfoReply*. \r\n\r\nThis will cause panic.\r\n\r\nI have report it to https://bugs.freedesktop.org/show_bug.cgi?id=73180 "},"comment":{"url":"https://api.github.com/repos/BurntSushi/xgb/issues/comments/184950650","html_url":"https://github.com/BurntSushi/xgb/issues/20#issuecomment-184950650","issue_url":"https://api.github.com/repos/BurntSushi/xgb/issues/20","id":184950650,"user":{"login":"tv42","id":419909,"avatar_url":"https://avatars.githubusercontent.com/u/419909?v=3","gravatar_id":"","url":"https://api.github.com/users/tv42","html_url":"https://github.com/tv42","followers_url":"https://api.github.com/users/tv42/followers","following_url":"https://api.github.com/users/tv42/following{/other_user}","gists_url":"https://api.github.com/users/tv42/gists{/gist_id}","starred_url":"https://api.github.com/users/tv42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tv42/subscriptions","organizations_url":"https://api.github.com/users/tv42/orgs","repos_url":"https://api.github.com/users/tv42/repos","events_url":"https://api.github.com/users/tv42/events{/privacy}","received_events_url":"https://api.github.com/users/tv42/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T00:54:57Z","updated_at":"2016-02-17T00:54:57Z","body":"I'm seeing something similar with an out of bounds slice access in `randr.RefreshRatesRead`. This diff hides the problem for me:\r\n\r\n```\r\ndiff --git i/randr/randr.go w/randr/randr.go\r\nindex 20dc62a..d0e35ac 100644\r\n--- i/randr/randr.go\r\n+++ w/randr/randr.go\r\n@@ -1299,6 +1299,9 @@ type RefreshRates struct {\r\n \r\n // RefreshRatesRead reads a byte slice into a RefreshRates value.\r\n func RefreshRatesRead(buf []byte, v *RefreshRates) int {\r\n+       if len(buf) == 0 {\r\n+               return 0\r\n+       }\r\n        b := 0\r\n \r\n        v.NRates = xgb.Get16(buf[b:])\r\n```"}}