{"action":"created","issue":{"url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/issues/883","labels_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/issues/883/labels{/name}","comments_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/issues/883/comments","events_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/issues/883/events","html_url":"https://github.com/notepad-plus-plus/notepad-plus-plus/issues/883","id":105718370,"number":883,"title":"batshit insane const-removing cast","user":{"login":"ariccio","id":2142308,"avatar_url":"https://avatars.githubusercontent.com/u/2142308?v=3","gravatar_id":"","url":"https://api.github.com/users/ariccio","html_url":"https://github.com/ariccio","followers_url":"https://api.github.com/users/ariccio/followers","following_url":"https://api.github.com/users/ariccio/following{/other_user}","gists_url":"https://api.github.com/users/ariccio/gists{/gist_id}","starred_url":"https://api.github.com/users/ariccio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ariccio/subscriptions","organizations_url":"https://api.github.com/users/ariccio/orgs","repos_url":"https://api.github.com/users/ariccio/repos","events_url":"https://api.github.com/users/ariccio/events{/privacy}","received_events_url":"https://api.github.com/users/ariccio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-10T02:06:44Z","updated_at":"2015-09-10T02:12:33Z","closed_at":null,"body":"I was digging through a historically buggy function, and noticed that commit 3464682ef667f8f2916a39200dffa38af938e5ca introduced a const-removing cast:\r\n\r\n```\r\ndata->pszName\t\t= (TCHAR *)_pluginName.c_str();\r\n```\r\n\r\nThe return value of `c_str()` is ***NOT*** writable!\r\n\r\nThe commit was apparently *intended* to prevent a crash, but there was no comment on how in the hell this makes sense."},"comment":{"url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/issues/comments/139096511","html_url":"https://github.com/notepad-plus-plus/notepad-plus-plus/issues/883#issuecomment-139096511","issue_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/issues/883","id":139096511,"user":{"login":"ariccio","id":2142308,"avatar_url":"https://avatars.githubusercontent.com/u/2142308?v=3","gravatar_id":"","url":"https://api.github.com/users/ariccio","html_url":"https://github.com/ariccio","followers_url":"https://api.github.com/users/ariccio/followers","following_url":"https://api.github.com/users/ariccio/following{/other_user}","gists_url":"https://api.github.com/users/ariccio/gists{/gist_id}","starred_url":"https://api.github.com/users/ariccio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ariccio/subscriptions","organizations_url":"https://api.github.com/users/ariccio/orgs","repos_url":"https://api.github.com/users/ariccio/repos","events_url":"https://api.github.com/users/ariccio/events{/privacy}","received_events_url":"https://api.github.com/users/ariccio/received_events","type":"User","site_admin":false},"created_at":"2015-09-10T02:12:33Z","updated_at":"2015-09-10T02:12:33Z","body":"A previous crash apparently fixed in dd70030, involved this insane code:\r\n\r\n```\r\n::GetModuleFileName((HMODULE)hInst, (TCHAR *)_moduleName.c_str(), MAX_PATH);\r\n```\r\n\r\n... How the hell did anybody write that??!? Not only is there no guarantee that the `std::wstring`'s pointer member points to at least `MAX_PATH` characters of space, but it's *purposefully* `const`."}}