{"action":"created","issue":{"url":"https://api.github.com/repos/mintty/mintty/issues/828","repository_url":"https://api.github.com/repos/mintty/mintty","labels_url":"https://api.github.com/repos/mintty/mintty/issues/828/labels{/name}","comments_url":"https://api.github.com/repos/mintty/mintty/issues/828/comments","events_url":"https://api.github.com/repos/mintty/mintty/issues/828/events","html_url":"https://github.com/mintty/mintty/pull/828","id":386128782,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0OTQxMjI4","number":828,"title":"Avoid nested functions","user":{"login":"dscho","id":127790,"node_id":"MDQ6VXNlcjEyNzc5MA==","avatar_url":"https://avatars0.githubusercontent.com/u/127790?v=4","gravatar_id":"","url":"https://api.github.com/users/dscho","html_url":"https://github.com/dscho","followers_url":"https://api.github.com/users/dscho/followers","following_url":"https://api.github.com/users/dscho/following{/other_user}","gists_url":"https://api.github.com/users/dscho/gists{/gist_id}","starred_url":"https://api.github.com/users/dscho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dscho/subscriptions","organizations_url":"https://api.github.com/users/dscho/orgs","repos_url":"https://api.github.com/users/dscho/repos","events_url":"https://api.github.com/users/dscho/events{/privacy}","received_events_url":"https://api.github.com/users/dscho/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-11-30T10:31:39Z","updated_at":"2018-11-30T18:19:47Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/mintty/mintty/pulls/828","html_url":"https://github.com/mintty/mintty/pull/828","diff_url":"https://github.com/mintty/mintty/pull/828.diff","patch_url":"https://github.com/mintty/mintty/pull/828.patch"},"body":"It was reported to the oss-security mailing list in\r\nhttps://seclists.org/oss-sec/2018/q4/82 that GCC 7 and 8 have known\r\nissues generating code for nested functions, essentially voiding any\r\nData Execution Protection (DEP).\r\n\r\nAs it is unclear how quickly GCC can be fixed, let's just avoid the\r\nnested functions altogether.\r\n\r\nSee https://github.com/git-for-windows/git/issues/1725 for the discussion on the Git for Windows issue tracker that triggered my working on this PR.\r\n\r\nNote: this patch mainly moves the nested functions out of their previous\r\nhost function, if necessary adds a suffix to the function name, and in\r\nseveral cases declares structures to be passed via the `lParam` argument\r\nof the `Enum*()` functions, to retain access to the local variables of\r\nthe former host function.\r\n\r\nNote, too, that trailing whitespace was preserved faithfully when moving\r\nand de-indenting the code.\r\n\r\nAlso please note that this patch does *not* care about code that is not\r\ncompiled because it is hidden behind `#if ... #endif` guards.\r\n\r\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>"},"comment":{"url":"https://api.github.com/repos/mintty/mintty/issues/comments/443292811","html_url":"https://github.com/mintty/mintty/pull/828#issuecomment-443292811","issue_url":"https://api.github.com/repos/mintty/mintty/issues/828","id":443292811,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzI5MjgxMQ==","user":{"login":"dscho","id":127790,"node_id":"MDQ6VXNlcjEyNzc5MA==","avatar_url":"https://avatars0.githubusercontent.com/u/127790?v=4","gravatar_id":"","url":"https://api.github.com/users/dscho","html_url":"https://github.com/dscho","followers_url":"https://api.github.com/users/dscho/followers","following_url":"https://api.github.com/users/dscho/following{/other_user}","gists_url":"https://api.github.com/users/dscho/gists{/gist_id}","starred_url":"https://api.github.com/users/dscho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dscho/subscriptions","organizations_url":"https://api.github.com/users/dscho/orgs","repos_url":"https://api.github.com/users/dscho/repos","events_url":"https://api.github.com/users/dscho/events{/privacy}","received_events_url":"https://api.github.com/users/dscho/received_events","type":"User","site_admin":false},"created_at":"2018-11-30T18:19:47Z","updated_at":"2018-11-30T18:19:47Z","author_association":"NONE","body":"> Will need a few days of course.\r\n\r\nI would be interested in getting in a patch on Git for Windows' side early, as we are really close to Git for Windows v2.20.0 (probably sometime early this coming week). So any indication whether you throw out this PR in favor of your changes (that would extend the scope of the variables, opening the code to multi-threading issues) or whether you are inclined to take it, would be helpful in determining what route to take on my side.\r\n\r\n> I guess we share a bit the traditional rule to never change a running system\r\n\r\nRight. If it is buggy, it is of course not really running, and needs change.\r\n\r\n> considering also the wrapper, which could quite easily be fixed for the -w max issue...\r\n\r\nIsn't it frustrating how some users raise a wish and then are totally unwilling to lift even their little finger to have their wish fulfilled?\r\n\r\nIn this instance, I am quite willing to say that this person gets what they want as soon as they show a bit of an eagerness to also do something about it. We're not kindergarten teachers over here, after all, and they are grown-up users, not toddlers."}}
{"actor":{"display_login":"dscho"}}