{"action":"created","comment":{"url":"https://api.github.com/repos/randombit/botan/pulls/comments/32894027","id":32894027,"diff_hunk":"@@ -139,7 +139,7 @@ bool PSSR::verify(const secure_vector<byte>& const_coded,\n    hash->update(&DB[salt_offset], DB_size - salt_offset);\n    secure_vector<byte> H2 = hash->final();\n \n-   return same_mem(&H[0], &H2[0], HASH_SIZE);\n+   return same_mem(H, H2.data(), HASH_SIZE);","path":"src/lib/pk_pad/emsa_pssr/pssr.cpp","position":30,"original_position":30,"commit_id":"bd5427214f0acba796f43bd6289f860fbed73519","original_commit_id":"bd5427214f0acba796f43bd6289f860fbed73519","user":{"login":"webmaster128","id":2603011,"avatar_url":"https://avatars.githubusercontent.com/u/2603011?v=3","gravatar_id":"","url":"https://api.github.com/users/webmaster128","html_url":"https://github.com/webmaster128","followers_url":"https://api.github.com/users/webmaster128/followers","following_url":"https://api.github.com/users/webmaster128/following{/other_user}","gists_url":"https://api.github.com/users/webmaster128/gists{/gist_id}","starred_url":"https://api.github.com/users/webmaster128/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webmaster128/subscriptions","organizations_url":"https://api.github.com/users/webmaster128/orgs","repos_url":"https://api.github.com/users/webmaster128/repos","events_url":"https://api.github.com/users/webmaster128/events{/privacy}","received_events_url":"https://api.github.com/users/webmaster128/received_events","type":"User","site_admin":false},"body":"Okay thx. I din't see that operator[] dereferenes a raw C-pointer","created_at":"2015-06-21T14:42:32Z","updated_at":"2015-06-21T14:42:32Z","html_url":"https://github.com/randombit/botan/pull/122#discussion_r32894027","pull_request_url":"https://api.github.com/repos/randombit/botan/pulls/122","_links":{"self":{"href":"https://api.github.com/repos/randombit/botan/pulls/comments/32894027"},"html":{"href":"https://github.com/randombit/botan/pull/122#discussion_r32894027"},"pull_request":{"href":"https://api.github.com/repos/randombit/botan/pulls/122"}}},"pull_request":{"url":"https://api.github.com/repos/randombit/botan/pulls/122","id":38171166,"html_url":"https://github.com/randombit/botan/pull/122","diff_url":"https://github.com/randombit/botan/pull/122.diff","patch_url":"https://github.com/randombit/botan/pull/122.patch","issue_url":"https://api.github.com/repos/randombit/botan/issues/122","number":122,"state":"open","locked":false,"title":"Use a.data() instead of &a[0] for containers, round 1","user":{"login":"tiwoc","id":1260821,"avatar_url":"https://avatars.githubusercontent.com/u/1260821?v=3","gravatar_id":"","url":"https://api.github.com/users/tiwoc","html_url":"https://github.com/tiwoc","followers_url":"https://api.github.com/users/tiwoc/followers","following_url":"https://api.github.com/users/tiwoc/following{/other_user}","gists_url":"https://api.github.com/users/tiwoc/gists{/gist_id}","starred_url":"https://api.github.com/users/tiwoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiwoc/subscriptions","organizations_url":"https://api.github.com/users/tiwoc/orgs","repos_url":"https://api.github.com/users/tiwoc/repos","events_url":"https://api.github.com/users/tiwoc/events{/privacy}","received_events_url":"https://api.github.com/users/tiwoc/received_events","type":"User","site_admin":false},"body":"This is part 1 of a series of PRs that will replace the now closed PR #49. It fixes issues with the subtrees `lib/filters`, `lib/math`, `lib/alloc` and `lib/pk_pad`. More PRs for other subtrees will follow in the next weeks, as soon as I find time.\r\n\r\nFor the sake of completeness, here comes a slightly adapted repetition of the original PR's description:\r\n\r\nWhen running a program which was compiled by MSVC in debug mode, vectors and strings complain with an assertion if elements which are out of bounds are accessed. In the Botan sources, the idiom &a[0] is frequently used to get the address of the underlying raw data of a container. This clashes with the above behavior in the case that the container is empty. The alternative syntax a.data() works just fine.\r\n\r\nFor these patches, I first ran the following command:\r\n\r\n    find . -type f -print0 | xargs -0 sed -ri 's/&([a-zA-Z_]+)\\[0\\]/\\1.data()/g'\r\n\r\nAfterwards, I manually reviewed all changes, reverting false positives and other inappropriate changes, and changed some occurrences of nonzero indexes when I became aware of them (`&a[foo]` where foo != 0).","created_at":"2015-06-20T17:17:31Z","updated_at":"2015-06-21T14:42:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"554425588096e0394c5dd2bf8868a950208dc01d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/randombit/botan/pulls/122/commits","review_comments_url":"https://api.github.com/repos/randombit/botan/pulls/122/comments","review_comment_url":"https://api.github.com/repos/randombit/botan/pulls/comments{/number}","comments_url":"https://api.github.com/repos/randombit/botan/issues/122/comments","statuses_url":"https://api.github.com/repos/randombit/botan/statuses/bd5427214f0acba796f43bd6289f860fbed73519","head":{"label":"tiwoc:fix-msvc-debug-1","ref":"fix-msvc-debug-1","sha":"bd5427214f0acba796f43bd6289f860fbed73519","user":{"login":"tiwoc","id":1260821,"avatar_url":"https://avatars.githubusercontent.com/u/1260821?v=3","gravatar_id":"","url":"https://api.github.com/users/tiwoc","html_url":"https://github.com/tiwoc","followers_url":"https://api.github.com/users/tiwoc/followers","following_url":"https://api.github.com/users/tiwoc/following{/other_user}","gists_url":"https://api.github.com/users/tiwoc/gists{/gist_id}","starred_url":"https://api.github.com/users/tiwoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiwoc/subscriptions","organizations_url":"https://api.github.com/users/tiwoc/orgs","repos_url":"https://api.github.com/users/tiwoc/repos","events_url":"https://api.github.com/users/tiwoc/events{/privacy}","received_events_url":"https://api.github.com/users/tiwoc/received_events","type":"User","site_admin":false},"repo":{"id":27933832,"name":"botan","full_name":"tiwoc/botan","owner":{"login":"tiwoc","id":1260821,"avatar_url":"https://avatars.githubusercontent.com/u/1260821?v=3","gravatar_id":"","url":"https://api.github.com/users/tiwoc","html_url":"https://github.com/tiwoc","followers_url":"https://api.github.com/users/tiwoc/followers","following_url":"https://api.github.com/users/tiwoc/following{/other_user}","gists_url":"https://api.github.com/users/tiwoc/gists{/gist_id}","starred_url":"https://api.github.com/users/tiwoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiwoc/subscriptions","organizations_url":"https://api.github.com/users/tiwoc/orgs","repos_url":"https://api.github.com/users/tiwoc/repos","events_url":"https://api.github.com/users/tiwoc/events{/privacy}","received_events_url":"https://api.github.com/users/tiwoc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tiwoc/botan","description":"Crypto and TLS for C++11","fork":true,"url":"https://api.github.com/repos/tiwoc/botan","forks_url":"https://api.github.com/repos/tiwoc/botan/forks","keys_url":"https://api.github.com/repos/tiwoc/botan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tiwoc/botan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tiwoc/botan/teams","hooks_url":"https://api.github.com/repos/tiwoc/botan/hooks","issue_events_url":"https://api.github.com/repos/tiwoc/botan/issues/events{/number}","events_url":"https://api.github.com/repos/tiwoc/botan/events","assignees_url":"https://api.github.com/repos/tiwoc/botan/assignees{/user}","branches_url":"https://api.github.com/repos/tiwoc/botan/branches{/branch}","tags_url":"https://api.github.com/repos/tiwoc/botan/tags","blobs_url":"https://api.github.com/repos/tiwoc/botan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tiwoc/botan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tiwoc/botan/git/refs{/sha}","trees_url":"https://api.github.com/repos/tiwoc/botan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tiwoc/botan/statuses/{sha}","languages_url":"https://api.github.com/repos/tiwoc/botan/languages","stargazers_url":"https://api.github.com/repos/tiwoc/botan/stargazers","contributors_url":"https://api.github.com/repos/tiwoc/botan/contributors","subscribers_url":"https://api.github.com/repos/tiwoc/botan/subscribers","subscription_url":"https://api.github.com/repos/tiwoc/botan/subscription","commits_url":"https://api.github.com/repos/tiwoc/botan/commits{/sha}","git_commits_url":"https://api.github.com/repos/tiwoc/botan/git/commits{/sha}","comments_url":"https://api.github.com/repos/tiwoc/botan/comments{/number}","issue_comment_url":"https://api.github.com/repos/tiwoc/botan/issues/comments{/number}","contents_url":"https://api.github.com/repos/tiwoc/botan/contents/{+path}","compare_url":"https://api.github.com/repos/tiwoc/botan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tiwoc/botan/merges","archive_url":"https://api.github.com/repos/tiwoc/botan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tiwoc/botan/downloads","issues_url":"https://api.github.com/repos/tiwoc/botan/issues{/number}","pulls_url":"https://api.github.com/repos/tiwoc/botan/pulls{/number}","milestones_url":"https://api.github.com/repos/tiwoc/botan/milestones{/number}","notifications_url":"https://api.github.com/repos/tiwoc/botan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tiwoc/botan/labels{/name}","releases_url":"https://api.github.com/repos/tiwoc/botan/releases{/id}","created_at":"2014-12-12T19:00:10Z","updated_at":"2015-02-10T20:03:53Z","pushed_at":"2015-06-20T17:05:33Z","git_url":"git://github.com/tiwoc/botan.git","ssh_url":"git@github.com:tiwoc/botan.git","clone_url":"https://github.com/tiwoc/botan.git","svn_url":"https://github.com/tiwoc/botan","homepage":"http://botan.randombit.net","size":50769,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"randombit:master","ref":"master","sha":"7dcf597fe0a7e513977e50758d649e86416f1a43","user":{"login":"randombit","id":469092,"avatar_url":"https://avatars.githubusercontent.com/u/469092?v=3","gravatar_id":"","url":"https://api.github.com/users/randombit","html_url":"https://github.com/randombit","followers_url":"https://api.github.com/users/randombit/followers","following_url":"https://api.github.com/users/randombit/following{/other_user}","gists_url":"https://api.github.com/users/randombit/gists{/gist_id}","starred_url":"https://api.github.com/users/randombit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/randombit/subscriptions","organizations_url":"https://api.github.com/users/randombit/orgs","repos_url":"https://api.github.com/users/randombit/repos","events_url":"https://api.github.com/users/randombit/events{/privacy}","received_events_url":"https://api.github.com/users/randombit/received_events","type":"User","site_admin":false},"repo":{"id":8608254,"name":"botan","full_name":"randombit/botan","owner":{"login":"randombit","id":469092,"avatar_url":"https://avatars.githubusercontent.com/u/469092?v=3","gravatar_id":"","url":"https://api.github.com/users/randombit","html_url":"https://github.com/randombit","followers_url":"https://api.github.com/users/randombit/followers","following_url":"https://api.github.com/users/randombit/following{/other_user}","gists_url":"https://api.github.com/users/randombit/gists{/gist_id}","starred_url":"https://api.github.com/users/randombit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/randombit/subscriptions","organizations_url":"https://api.github.com/users/randombit/orgs","repos_url":"https://api.github.com/users/randombit/repos","events_url":"https://api.github.com/users/randombit/events{/privacy}","received_events_url":"https://api.github.com/users/randombit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/randombit/botan","description":"Crypto and TLS for C++11","fork":false,"url":"https://api.github.com/repos/randombit/botan","forks_url":"https://api.github.com/repos/randombit/botan/forks","keys_url":"https://api.github.com/repos/randombit/botan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/randombit/botan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/randombit/botan/teams","hooks_url":"https://api.github.com/repos/randombit/botan/hooks","issue_events_url":"https://api.github.com/repos/randombit/botan/issues/events{/number}","events_url":"https://api.github.com/repos/randombit/botan/events","assignees_url":"https://api.github.com/repos/randombit/botan/assignees{/user}","branches_url":"https://api.github.com/repos/randombit/botan/branches{/branch}","tags_url":"https://api.github.com/repos/randombit/botan/tags","blobs_url":"https://api.github.com/repos/randombit/botan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/randombit/botan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/randombit/botan/git/refs{/sha}","trees_url":"https://api.github.com/repos/randombit/botan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/randombit/botan/statuses/{sha}","languages_url":"https://api.github.com/repos/randombit/botan/languages","stargazers_url":"https://api.github.com/repos/randombit/botan/stargazers","contributors_url":"https://api.github.com/repos/randombit/botan/contributors","subscribers_url":"https://api.github.com/repos/randombit/botan/subscribers","subscription_url":"https://api.github.com/repos/randombit/botan/subscription","commits_url":"https://api.github.com/repos/randombit/botan/commits{/sha}","git_commits_url":"https://api.github.com/repos/randombit/botan/git/commits{/sha}","comments_url":"https://api.github.com/repos/randombit/botan/comments{/number}","issue_comment_url":"https://api.github.com/repos/randombit/botan/issues/comments{/number}","contents_url":"https://api.github.com/repos/randombit/botan/contents/{+path}","compare_url":"https://api.github.com/repos/randombit/botan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/randombit/botan/merges","archive_url":"https://api.github.com/repos/randombit/botan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/randombit/botan/downloads","issues_url":"https://api.github.com/repos/randombit/botan/issues{/number}","pulls_url":"https://api.github.com/repos/randombit/botan/pulls{/number}","milestones_url":"https://api.github.com/repos/randombit/botan/milestones{/number}","notifications_url":"https://api.github.com/repos/randombit/botan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/randombit/botan/labels{/name}","releases_url":"https://api.github.com/repos/randombit/botan/releases{/id}","created_at":"2013-03-06T16:51:39Z","updated_at":"2015-06-19T21:16:27Z","pushed_at":"2015-06-20T17:17:33Z","git_url":"git://github.com/randombit/botan.git","ssh_url":"git@github.com:randombit/botan.git","clone_url":"https://github.com/randombit/botan.git","svn_url":"https://github.com/randombit/botan","homepage":"http://botan.randombit.net","size":60381,"stargazers_count":118,"watchers_count":118,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":21,"forks":33,"open_issues":21,"watchers":118,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/randombit/botan/pulls/122"},"html":{"href":"https://github.com/randombit/botan/pull/122"},"issue":{"href":"https://api.github.com/repos/randombit/botan/issues/122"},"comments":{"href":"https://api.github.com/repos/randombit/botan/issues/122/comments"},"review_comments":{"href":"https://api.github.com/repos/randombit/botan/pulls/122/comments"},"review_comment":{"href":"https://api.github.com/repos/randombit/botan/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/randombit/botan/pulls/122/commits"},"statuses":{"href":"https://api.github.com/repos/randombit/botan/statuses/bd5427214f0acba796f43bd6289f860fbed73519"}}}}