{"action":"created","comment":{"url":"https://api.github.com/repos/openssl/openssl/pulls/comments/51718022","id":51718022,"diff_hunk":"@@ -280,23 +280,27 @@ static char *dlfcn_merger(DSO *dso, const char *filespec1,\n      * if the second file specification is missing.\n      */\n     if (!filespec2 || (filespec1 != NULL && filespec1[0] == '/')) {\n-        merged = OPENSSL_malloc(strlen(filespec1) + 1);\n+        size_t size;\n+        size = strlen(filespec1) + 1;\n+        merged = OPENSSL_malloc(size);","path":"crypto/dso/dso_dlfcn.c","position":7,"original_position":7,"commit_id":"172953576fe4d67a9cf4c0fbce43832c2404294f","original_commit_id":"172953576fe4d67a9cf4c0fbce43832c2404294f","user":{"login":"richsalz","id":7332500,"avatar_url":"https://avatars.githubusercontent.com/u/7332500?v=3","gravatar_id":"","url":"https://api.github.com/users/richsalz","html_url":"https://github.com/richsalz","followers_url":"https://api.github.com/users/richsalz/followers","following_url":"https://api.github.com/users/richsalz/following{/other_user}","gists_url":"https://api.github.com/users/richsalz/gists{/gist_id}","starred_url":"https://api.github.com/users/richsalz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richsalz/subscriptions","organizations_url":"https://api.github.com/users/richsalz/orgs","repos_url":"https://api.github.com/users/richsalz/repos","events_url":"https://api.github.com/users/richsalz/events{/privacy}","received_events_url":"https://api.github.com/users/richsalz/received_events","type":"User","site_admin":false},"body":"again, OPENSSL_strdup.","created_at":"2016-02-03T13:10:17Z","updated_at":"2016-02-03T13:10:17Z","html_url":"https://github.com/openssl/openssl/pull/614#discussion_r51718022","pull_request_url":"https://api.github.com/repos/openssl/openssl/pulls/614","_links":{"self":{"href":"https://api.github.com/repos/openssl/openssl/pulls/comments/51718022"},"html":{"href":"https://github.com/openssl/openssl/pull/614#discussion_r51718022"},"pull_request":{"href":"https://api.github.com/repos/openssl/openssl/pulls/614"}}},"pull_request":{"url":"https://api.github.com/repos/openssl/openssl/pulls/614","id":58101919,"html_url":"https://github.com/openssl/openssl/pull/614","diff_url":"https://github.com/openssl/openssl/pull/614.diff","patch_url":"https://github.com/openssl/openssl/pull/614.patch","issue_url":"https://api.github.com/repos/openssl/openssl/issues/614","number":614,"state":"open","locked":false,"title":"Use memcpy() when possible","user":{"login":"Dmitry-Me","id":1277095,"avatar_url":"https://avatars.githubusercontent.com/u/1277095?v=3","gravatar_id":"","url":"https://api.github.com/users/Dmitry-Me","html_url":"https://github.com/Dmitry-Me","followers_url":"https://api.github.com/users/Dmitry-Me/followers","following_url":"https://api.github.com/users/Dmitry-Me/following{/other_user}","gists_url":"https://api.github.com/users/Dmitry-Me/gists{/gist_id}","starred_url":"https://api.github.com/users/Dmitry-Me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dmitry-Me/subscriptions","organizations_url":"https://api.github.com/users/Dmitry-Me/orgs","repos_url":"https://api.github.com/users/Dmitry-Me/repos","events_url":"https://api.github.com/users/Dmitry-Me/events{/privacy}","received_events_url":"https://api.github.com/users/Dmitry-Me/received_events","type":"User","site_admin":false},"body":"There's no point in calling `strlen()` and then `strcpy()` - just remember what `strlen()` returned and then use `memcpy()`. The original code causes more questions than needed and will likely be broken when being adapted to \"secure string functions\" like `strcpy_s()`.","created_at":"2016-02-03T07:45:25Z","updated_at":"2016-02-03T13:10:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb7c88c22ec1ef170934546b10d79bccfda645ed","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openssl/openssl/pulls/614/commits","review_comments_url":"https://api.github.com/repos/openssl/openssl/pulls/614/comments","review_comment_url":"https://api.github.com/repos/openssl/openssl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openssl/openssl/issues/614/comments","statuses_url":"https://api.github.com/repos/openssl/openssl/statuses/172953576fe4d67a9cf4c0fbce43832c2404294f","head":{"label":"Dmitry-Me:dontScanTheStringTwice","ref":"dontScanTheStringTwice","sha":"172953576fe4d67a9cf4c0fbce43832c2404294f","user":{"login":"Dmitry-Me","id":1277095,"avatar_url":"https://avatars.githubusercontent.com/u/1277095?v=3","gravatar_id":"","url":"https://api.github.com/users/Dmitry-Me","html_url":"https://github.com/Dmitry-Me","followers_url":"https://api.github.com/users/Dmitry-Me/followers","following_url":"https://api.github.com/users/Dmitry-Me/following{/other_user}","gists_url":"https://api.github.com/users/Dmitry-Me/gists{/gist_id}","starred_url":"https://api.github.com/users/Dmitry-Me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dmitry-Me/subscriptions","organizations_url":"https://api.github.com/users/Dmitry-Me/orgs","repos_url":"https://api.github.com/users/Dmitry-Me/repos","events_url":"https://api.github.com/users/Dmitry-Me/events{/privacy}","received_events_url":"https://api.github.com/users/Dmitry-Me/received_events","type":"User","site_admin":false},"repo":{"id":19453266,"name":"openssl","full_name":"Dmitry-Me/openssl","owner":{"login":"Dmitry-Me","id":1277095,"avatar_url":"https://avatars.githubusercontent.com/u/1277095?v=3","gravatar_id":"","url":"https://api.github.com/users/Dmitry-Me","html_url":"https://github.com/Dmitry-Me","followers_url":"https://api.github.com/users/Dmitry-Me/followers","following_url":"https://api.github.com/users/Dmitry-Me/following{/other_user}","gists_url":"https://api.github.com/users/Dmitry-Me/gists{/gist_id}","starred_url":"https://api.github.com/users/Dmitry-Me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dmitry-Me/subscriptions","organizations_url":"https://api.github.com/users/Dmitry-Me/orgs","repos_url":"https://api.github.com/users/Dmitry-Me/repos","events_url":"https://api.github.com/users/Dmitry-Me/events{/privacy}","received_events_url":"https://api.github.com/users/Dmitry-Me/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Dmitry-Me/openssl","description":"","fork":true,"url":"https://api.github.com/repos/Dmitry-Me/openssl","forks_url":"https://api.github.com/repos/Dmitry-Me/openssl/forks","keys_url":"https://api.github.com/repos/Dmitry-Me/openssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Dmitry-Me/openssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Dmitry-Me/openssl/teams","hooks_url":"https://api.github.com/repos/Dmitry-Me/openssl/hooks","issue_events_url":"https://api.github.com/repos/Dmitry-Me/openssl/issues/events{/number}","events_url":"https://api.github.com/repos/Dmitry-Me/openssl/events","assignees_url":"https://api.github.com/repos/Dmitry-Me/openssl/assignees{/user}","branches_url":"https://api.github.com/repos/Dmitry-Me/openssl/branches{/branch}","tags_url":"https://api.github.com/repos/Dmitry-Me/openssl/tags","blobs_url":"https://api.github.com/repos/Dmitry-Me/openssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Dmitry-Me/openssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Dmitry-Me/openssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/Dmitry-Me/openssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Dmitry-Me/openssl/statuses/{sha}","languages_url":"https://api.github.com/repos/Dmitry-Me/openssl/languages","stargazers_url":"https://api.github.com/repos/Dmitry-Me/openssl/stargazers","contributors_url":"https://api.github.com/repos/Dmitry-Me/openssl/contributors","subscribers_url":"https://api.github.com/repos/Dmitry-Me/openssl/subscribers","subscription_url":"https://api.github.com/repos/Dmitry-Me/openssl/subscription","commits_url":"https://api.github.com/repos/Dmitry-Me/openssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/Dmitry-Me/openssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/Dmitry-Me/openssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/Dmitry-Me/openssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/Dmitry-Me/openssl/contents/{+path}","compare_url":"https://api.github.com/repos/Dmitry-Me/openssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Dmitry-Me/openssl/merges","archive_url":"https://api.github.com/repos/Dmitry-Me/openssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Dmitry-Me/openssl/downloads","issues_url":"https://api.github.com/repos/Dmitry-Me/openssl/issues{/number}","pulls_url":"https://api.github.com/repos/Dmitry-Me/openssl/pulls{/number}","milestones_url":"https://api.github.com/repos/Dmitry-Me/openssl/milestones{/number}","notifications_url":"https://api.github.com/repos/Dmitry-Me/openssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Dmitry-Me/openssl/labels{/name}","releases_url":"https://api.github.com/repos/Dmitry-Me/openssl/releases{/id}","deployments_url":"https://api.github.com/repos/Dmitry-Me/openssl/deployments","created_at":"2014-05-05T11:12:19Z","updated_at":"2016-02-01T15:42:59Z","pushed_at":"2016-02-03T09:32:25Z","git_url":"git://github.com/Dmitry-Me/openssl.git","ssh_url":"git@github.com:Dmitry-Me/openssl.git","clone_url":"https://github.com/Dmitry-Me/openssl.git","svn_url":"https://github.com/Dmitry-Me/openssl","homepage":null,"size":68005,"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":"openssl:master","ref":"master","sha":"0c20802c6a6008b28bfb0eac67d69f536edc60a7","user":{"login":"openssl","id":3279138,"avatar_url":"https://avatars.githubusercontent.com/u/3279138?v=3","gravatar_id":"","url":"https://api.github.com/users/openssl","html_url":"https://github.com/openssl","followers_url":"https://api.github.com/users/openssl/followers","following_url":"https://api.github.com/users/openssl/following{/other_user}","gists_url":"https://api.github.com/users/openssl/gists{/gist_id}","starred_url":"https://api.github.com/users/openssl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openssl/subscriptions","organizations_url":"https://api.github.com/users/openssl/orgs","repos_url":"https://api.github.com/users/openssl/repos","events_url":"https://api.github.com/users/openssl/events{/privacy}","received_events_url":"https://api.github.com/users/openssl/received_events","type":"Organization","site_admin":false},"repo":{"id":7634677,"name":"openssl","full_name":"openssl/openssl","owner":{"login":"openssl","id":3279138,"avatar_url":"https://avatars.githubusercontent.com/u/3279138?v=3","gravatar_id":"","url":"https://api.github.com/users/openssl","html_url":"https://github.com/openssl","followers_url":"https://api.github.com/users/openssl/followers","following_url":"https://api.github.com/users/openssl/following{/other_user}","gists_url":"https://api.github.com/users/openssl/gists{/gist_id}","starred_url":"https://api.github.com/users/openssl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openssl/subscriptions","organizations_url":"https://api.github.com/users/openssl/orgs","repos_url":"https://api.github.com/users/openssl/repos","events_url":"https://api.github.com/users/openssl/events{/privacy}","received_events_url":"https://api.github.com/users/openssl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openssl/openssl","description":"TLS/SSL and crypto library","fork":false,"url":"https://api.github.com/repos/openssl/openssl","forks_url":"https://api.github.com/repos/openssl/openssl/forks","keys_url":"https://api.github.com/repos/openssl/openssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openssl/openssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openssl/openssl/teams","hooks_url":"https://api.github.com/repos/openssl/openssl/hooks","issue_events_url":"https://api.github.com/repos/openssl/openssl/issues/events{/number}","events_url":"https://api.github.com/repos/openssl/openssl/events","assignees_url":"https://api.github.com/repos/openssl/openssl/assignees{/user}","branches_url":"https://api.github.com/repos/openssl/openssl/branches{/branch}","tags_url":"https://api.github.com/repos/openssl/openssl/tags","blobs_url":"https://api.github.com/repos/openssl/openssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openssl/openssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openssl/openssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/openssl/openssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openssl/openssl/statuses/{sha}","languages_url":"https://api.github.com/repos/openssl/openssl/languages","stargazers_url":"https://api.github.com/repos/openssl/openssl/stargazers","contributors_url":"https://api.github.com/repos/openssl/openssl/contributors","subscribers_url":"https://api.github.com/repos/openssl/openssl/subscribers","subscription_url":"https://api.github.com/repos/openssl/openssl/subscription","commits_url":"https://api.github.com/repos/openssl/openssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/openssl/openssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/openssl/openssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/openssl/openssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/openssl/openssl/contents/{+path}","compare_url":"https://api.github.com/repos/openssl/openssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openssl/openssl/merges","archive_url":"https://api.github.com/repos/openssl/openssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openssl/openssl/downloads","issues_url":"https://api.github.com/repos/openssl/openssl/issues{/number}","pulls_url":"https://api.github.com/repos/openssl/openssl/pulls{/number}","milestones_url":"https://api.github.com/repos/openssl/openssl/milestones{/number}","notifications_url":"https://api.github.com/repos/openssl/openssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openssl/openssl/labels{/name}","releases_url":"https://api.github.com/repos/openssl/openssl/releases{/id}","deployments_url":"https://api.github.com/repos/openssl/openssl/deployments","created_at":"2013-01-15T22:34:48Z","updated_at":"2016-02-03T09:33:08Z","pushed_at":"2016-02-03T09:43:02Z","git_url":"git://github.com/openssl/openssl.git","ssh_url":"git@github.com:openssl/openssl.git","clone_url":"https://github.com/openssl/openssl.git","svn_url":"https://github.com/openssl/openssl","homepage":"https://www.openssl.org","size":84812,"stargazers_count":2066,"watchers_count":2066,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1225,"mirror_url":null,"open_issues_count":155,"forks":1225,"open_issues":155,"watchers":2066,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openssl/openssl/pulls/614"},"html":{"href":"https://github.com/openssl/openssl/pull/614"},"issue":{"href":"https://api.github.com/repos/openssl/openssl/issues/614"},"comments":{"href":"https://api.github.com/repos/openssl/openssl/issues/614/comments"},"review_comments":{"href":"https://api.github.com/repos/openssl/openssl/pulls/614/comments"},"review_comment":{"href":"https://api.github.com/repos/openssl/openssl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openssl/openssl/pulls/614/commits"},"statuses":{"href":"https://api.github.com/repos/openssl/openssl/statuses/172953576fe4d67a9cf4c0fbce43832c2404294f"}}}}