{"action":"created","issue":{"url":"https://api.github.com/repos/percona/percona-xtrabackup/issues/273","repository_url":"https://api.github.com/repos/percona/percona-xtrabackup","labels_url":"https://api.github.com/repos/percona/percona-xtrabackup/issues/273/labels{/name}","comments_url":"https://api.github.com/repos/percona/percona-xtrabackup/issues/273/comments","events_url":"https://api.github.com/repos/percona/percona-xtrabackup/issues/273/events","html_url":"https://github.com/percona/percona-xtrabackup/pull/273","id":190324446,"number":273,"title":"Bug fix for https://bugs.launchpad.net/percona-xtrabackup/2.3/+bug/1642329","user":{"login":"elshadaghazade","id":3605068,"avatar_url":"https://avatars.githubusercontent.com/u/3605068?v=3","gravatar_id":"","url":"https://api.github.com/users/elshadaghazade","html_url":"https://github.com/elshadaghazade","followers_url":"https://api.github.com/users/elshadaghazade/followers","following_url":"https://api.github.com/users/elshadaghazade/following{/other_user}","gists_url":"https://api.github.com/users/elshadaghazade/gists{/gist_id}","starred_url":"https://api.github.com/users/elshadaghazade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elshadaghazade/subscriptions","organizations_url":"https://api.github.com/users/elshadaghazade/orgs","repos_url":"https://api.github.com/users/elshadaghazade/repos","events_url":"https://api.github.com/users/elshadaghazade/events{/privacy}","received_events_url":"https://api.github.com/users/elshadaghazade/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-18T13:54:43Z","updated_at":"2016-11-18T16:44:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/percona/percona-xtrabackup/pulls/273","html_url":"https://github.com/percona/percona-xtrabackup/pull/273","diff_url":"https://github.com/percona/percona-xtrabackup/pull/273.diff","patch_url":"https://github.com/percona/percona-xtrabackup/pull/273.patch"},"body":"The reason of the bug was that, strcend function puts the pointer to the end of the string in argv: optend = strcend(argv[i], '=');\r\nIf we send only -- -- string at the parameter than we enter the first if: \r\nif (strncmp(argv[i], \"--defaults-group\",\r\n optend - argv[i]) == 0) {\r\n defaults_group = optend + 1;\r\n append_defaults_group(defaults_group);\r\n}\r\n\r\nAs you see the value of the defaults_group is optend + 1. This makes a problem, because after the argv massive in the RAM comes some system ENV strings like TERM_PROGRAM=Apple_Terminal, SHELL=/bin/bash and etc. If you print defaults_group you can see this result. It seems OS keeps argv massive near the system environment strings in the RAM. \r\nFor this reason I copied the argv strings to the temporary string object to keep them in the secure place of RAM, then I gave this string to the strcend function like first parameter. After that, program worked correctly."},"comment":{"url":"https://api.github.com/repos/percona/percona-xtrabackup/issues/comments/261579471","html_url":"https://github.com/percona/percona-xtrabackup/pull/273#issuecomment-261579471","issue_url":"https://api.github.com/repos/percona/percona-xtrabackup/issues/273","id":261579471,"user":{"login":"gl-sergei","id":371194,"avatar_url":"https://avatars.githubusercontent.com/u/371194?v=3","gravatar_id":"","url":"https://api.github.com/users/gl-sergei","html_url":"https://github.com/gl-sergei","followers_url":"https://api.github.com/users/gl-sergei/followers","following_url":"https://api.github.com/users/gl-sergei/following{/other_user}","gists_url":"https://api.github.com/users/gl-sergei/gists{/gist_id}","starred_url":"https://api.github.com/users/gl-sergei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gl-sergei/subscriptions","organizations_url":"https://api.github.com/users/gl-sergei/orgs","repos_url":"https://api.github.com/users/gl-sergei/repos","events_url":"https://api.github.com/users/gl-sergei/events{/privacy}","received_events_url":"https://api.github.com/users/gl-sergei/received_events","type":"User","site_admin":false},"created_at":"2016-11-18T16:44:42Z","updated_at":"2016-11-18T16:44:42Z","body":"The bug analysis is correct, but the fix is not correct. It doesn't fix described problem. It just breaks handling of `--defaults-group` entirely, so `(strncmp(argv[i], \"--defaults-group\", optend - argv[i]) == 0)` will never be true."}}
{"actor":{"display_login":"gl-sergei"}}