{"action":"created","comment":{"url":"https://api.github.com/repos/eggheads/eggdrop/pulls/comments/227911326","pull_request_review_id":168058519,"id":227911326,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzkxMTMyNg==","diff_hunk":"@@ -416,16 +416,30 @@ static int ssl_verifycn(X509 *cert, ssl_appdata *data)\n  */\n static char *ssl_printname(X509_NAME *name)\n {\n-  int len;\n+  long len;\n   char *data, *buf;\n   BIO *bio = BIO_new(BIO_s_mem());\n \n   /* X509_NAME_oneline() is easier and shorter, but is deprecated and\n      the manual discourages it's usage, so let's not be lazy ;) */\n-  X509_NAME_print_ex(bio, name, 0, XN_FLAG_ONELINE & ~XN_FLAG_SPC_EQ);\n-  len = BIO_get_mem_data(bio, &data) + 1;\n-  buf = nmalloc(len);\n-  strlcpy(buf, data, len);\n+  if (X509_NAME_print_ex(bio, name, 0, XN_FLAG_ONELINE & ~XN_FLAG_SPC_EQ)) {\n+    len = BIO_get_mem_data(bio, &data);\n+    if (len > 0) {\n+      buf = nmalloc(len + 1);\n+      memcpy(buf, data, len); /* don't strlcpy() for it would read data[len] */\n+      buf[len] = 0;\n+    }\n+    else {","path":"src/tls.c","position":22,"original_position":22,"commit_id":"f4894f0fc18c140e071361229567d0fd0dcb1fb2","original_commit_id":"f4894f0fc18c140e071361229567d0fd0dcb1fb2","user":{"login":"Cizzle","id":709246,"node_id":"MDQ6VXNlcjcwOTI0Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/709246?v=4","gravatar_id":"","url":"https://api.github.com/users/Cizzle","html_url":"https://github.com/Cizzle","followers_url":"https://api.github.com/users/Cizzle/followers","following_url":"https://api.github.com/users/Cizzle/following{/other_user}","gists_url":"https://api.github.com/users/Cizzle/gists{/gist_id}","starred_url":"https://api.github.com/users/Cizzle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cizzle/subscriptions","organizations_url":"https://api.github.com/users/Cizzle/orgs","repos_url":"https://api.github.com/users/Cizzle/repos","events_url":"https://api.github.com/users/Cizzle/events{/privacy}","received_events_url":"https://api.github.com/users/Cizzle/received_events","type":"User","site_admin":false},"body":"Please combine with line above. Same for other blocks.","created_at":"2018-10-24T18:35:49Z","updated_at":"2018-10-24T18:35:50Z","html_url":"https://github.com/eggheads/eggdrop/pull/702#discussion_r227911326","pull_request_url":"https://api.github.com/repos/eggheads/eggdrop/pulls/702","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/eggheads/eggdrop/pulls/comments/227911326"},"html":{"href":"https://github.com/eggheads/eggdrop/pull/702#discussion_r227911326"},"pull_request":{"href":"https://api.github.com/repos/eggheads/eggdrop/pulls/702"}}},"pull_request":{"url":"https://api.github.com/repos/eggheads/eggdrop/pulls/702","id":222728028,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyNzI4MDI4","html_url":"https://github.com/eggheads/eggdrop/pull/702","diff_url":"https://github.com/eggheads/eggdrop/pull/702.diff","patch_url":"https://github.com/eggheads/eggdrop/pull/702.patch","issue_url":"https://api.github.com/repos/eggheads/eggdrop/issues/702","number":702,"state":"open","locked":false,"title":"Fix heap bug","user":{"login":"michaelortmann","id":41313082,"node_id":"MDQ6VXNlcjQxMzEzMDgy","avatar_url":"https://avatars1.githubusercontent.com/u/41313082?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelortmann","html_url":"https://github.com/michaelortmann","followers_url":"https://api.github.com/users/michaelortmann/followers","following_url":"https://api.github.com/users/michaelortmann/following{/other_user}","gists_url":"https://api.github.com/users/michaelortmann/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelortmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelortmann/subscriptions","organizations_url":"https://api.github.com/users/michaelortmann/orgs","repos_url":"https://api.github.com/users/michaelortmann/repos","events_url":"https://api.github.com/users/michaelortmann/events{/privacy}","received_events_url":"https://api.github.com/users/michaelortmann/received_events","type":"User","site_admin":false},"body":"Found by: michaelortmann\r\nPatch by: michaelortmann\r\nFixes: \r\n\r\nOne-line summary:\r\nFix heap bug\r\n\r\nAdditional description (if needed):\r\nThis bug could have made eggdrop fail on hardened systems.\r\nThe patch also adds error check for X509_NAME_print_ex()\r\nand enhances performance by some cpu cycles ;)\r\n\r\nTest cases demonstrating functionality (if applicable):\r\nTest with sharebots over ssl was successful, which tests at least the changed functions but also gives good overall impression.\r\nThe following eggdrop debug output is correct:\r\n`[18:47:31] TLS: certificate subject: C=EU, O=Eggheads, OU=Botnet, UID=sslbot`","created_at":"2018-10-14T16:53:55Z","updated_at":"2018-10-24T18:35:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d37c6f20171c0180e28446542dfdcd1cb54f776d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/eggheads/eggdrop/milestones/12","html_url":"https://github.com/eggheads/eggdrop/milestone/12","labels_url":"https://api.github.com/repos/eggheads/eggdrop/milestones/12/labels","id":3537557,"node_id":"MDk6TWlsZXN0b25lMzUzNzU1Nw==","number":12,"title":"v1.8.4","description":"","creator":{"login":"Cizzle","id":709246,"node_id":"MDQ6VXNlcjcwOTI0Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/709246?v=4","gravatar_id":"","url":"https://api.github.com/users/Cizzle","html_url":"https://github.com/Cizzle","followers_url":"https://api.github.com/users/Cizzle/followers","following_url":"https://api.github.com/users/Cizzle/following{/other_user}","gists_url":"https://api.github.com/users/Cizzle/gists{/gist_id}","starred_url":"https://api.github.com/users/Cizzle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cizzle/subscriptions","organizations_url":"https://api.github.com/users/Cizzle/orgs","repos_url":"https://api.github.com/users/Cizzle/repos","events_url":"https://api.github.com/users/Cizzle/events{/privacy}","received_events_url":"https://api.github.com/users/Cizzle/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":90,"state":"open","created_at":"2018-07-31T21:37:03Z","updated_at":"2018-10-24T18:30:00Z","due_on":"2018-12-01T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/eggheads/eggdrop/pulls/702/commits","review_comments_url":"https://api.github.com/repos/eggheads/eggdrop/pulls/702/comments","review_comment_url":"https://api.github.com/repos/eggheads/eggdrop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eggheads/eggdrop/issues/702/comments","statuses_url":"https://api.github.com/repos/eggheads/eggdrop/statuses/f4894f0fc18c140e071361229567d0fd0dcb1fb2","head":{"label":"michaelortmann:heap-bug","ref":"heap-bug","sha":"f4894f0fc18c140e071361229567d0fd0dcb1fb2","user":{"login":"michaelortmann","id":41313082,"node_id":"MDQ6VXNlcjQxMzEzMDgy","avatar_url":"https://avatars1.githubusercontent.com/u/41313082?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelortmann","html_url":"https://github.com/michaelortmann","followers_url":"https://api.github.com/users/michaelortmann/followers","following_url":"https://api.github.com/users/michaelortmann/following{/other_user}","gists_url":"https://api.github.com/users/michaelortmann/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelortmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelortmann/subscriptions","organizations_url":"https://api.github.com/users/michaelortmann/orgs","repos_url":"https://api.github.com/users/michaelortmann/repos","events_url":"https://api.github.com/users/michaelortmann/events{/privacy}","received_events_url":"https://api.github.com/users/michaelortmann/received_events","type":"User","site_admin":false},"repo":{"id":141218945,"node_id":"MDEwOlJlcG9zaXRvcnkxNDEyMTg5NDU=","name":"eggdrop","full_name":"michaelortmann/eggdrop","private":false,"owner":{"login":"michaelortmann","id":41313082,"node_id":"MDQ6VXNlcjQxMzEzMDgy","avatar_url":"https://avatars1.githubusercontent.com/u/41313082?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelortmann","html_url":"https://github.com/michaelortmann","followers_url":"https://api.github.com/users/michaelortmann/followers","following_url":"https://api.github.com/users/michaelortmann/following{/other_user}","gists_url":"https://api.github.com/users/michaelortmann/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelortmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelortmann/subscriptions","organizations_url":"https://api.github.com/users/michaelortmann/orgs","repos_url":"https://api.github.com/users/michaelortmann/repos","events_url":"https://api.github.com/users/michaelortmann/events{/privacy}","received_events_url":"https://api.github.com/users/michaelortmann/received_events","type":"User","site_admin":false},"html_url":"https://github.com/michaelortmann/eggdrop","description":"The Eggdrop IRC Bot","fork":true,"url":"https://api.github.com/repos/michaelortmann/eggdrop","forks_url":"https://api.github.com/repos/michaelortmann/eggdrop/forks","keys_url":"https://api.github.com/repos/michaelortmann/eggdrop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michaelortmann/eggdrop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michaelortmann/eggdrop/teams","hooks_url":"https://api.github.com/repos/michaelortmann/eggdrop/hooks","issue_events_url":"https://api.github.com/repos/michaelortmann/eggdrop/issues/events{/number}","events_url":"https://api.github.com/repos/michaelortmann/eggdrop/events","assignees_url":"https://api.github.com/repos/michaelortmann/eggdrop/assignees{/user}","branches_url":"https://api.github.com/repos/michaelortmann/eggdrop/branches{/branch}","tags_url":"https://api.github.com/repos/michaelortmann/eggdrop/tags","blobs_url":"https://api.github.com/repos/michaelortmann/eggdrop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michaelortmann/eggdrop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michaelortmann/eggdrop/git/refs{/sha}","trees_url":"https://api.github.com/repos/michaelortmann/eggdrop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michaelortmann/eggdrop/statuses/{sha}","languages_url":"https://api.github.com/repos/michaelortmann/eggdrop/languages","stargazers_url":"https://api.github.com/repos/michaelortmann/eggdrop/stargazers","contributors_url":"https://api.github.com/repos/michaelortmann/eggdrop/contributors","subscribers_url":"https://api.github.com/repos/michaelortmann/eggdrop/subscribers","subscription_url":"https://api.github.com/repos/michaelortmann/eggdrop/subscription","commits_url":"https://api.github.com/repos/michaelortmann/eggdrop/commits{/sha}","git_commits_url":"https://api.github.com/repos/michaelortmann/eggdrop/git/commits{/sha}","comments_url":"https://api.github.com/repos/michaelortmann/eggdrop/comments{/number}","issue_comment_url":"https://api.github.com/repos/michaelortmann/eggdrop/issues/comments{/number}","contents_url":"https://api.github.com/repos/michaelortmann/eggdrop/contents/{+path}","compare_url":"https://api.github.com/repos/michaelortmann/eggdrop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michaelortmann/eggdrop/merges","archive_url":"https://api.github.com/repos/michaelortmann/eggdrop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michaelortmann/eggdrop/downloads","issues_url":"https://api.github.com/repos/michaelortmann/eggdrop/issues{/number}","pulls_url":"https://api.github.com/repos/michaelortmann/eggdrop/pulls{/number}","milestones_url":"https://api.github.com/repos/michaelortmann/eggdrop/milestones{/number}","notifications_url":"https://api.github.com/repos/michaelortmann/eggdrop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michaelortmann/eggdrop/labels{/name}","releases_url":"https://api.github.com/repos/michaelortmann/eggdrop/releases{/id}","deployments_url":"https://api.github.com/repos/michaelortmann/eggdrop/deployments","created_at":"2018-07-17T02:16:55Z","updated_at":"2018-10-24T00:36:59Z","pushed_at":"2018-10-24T04:02:21Z","git_url":"git://github.com/michaelortmann/eggdrop.git","ssh_url":"git@github.com:michaelortmann/eggdrop.git","clone_url":"https://github.com/michaelortmann/eggdrop.git","svn_url":"https://github.com/michaelortmann/eggdrop","homepage":null,"size":16413,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"eggheads:develop","ref":"develop","sha":"9d3235385a38dc1b7a88330e4fa397f9a5230028","user":{"login":"eggheads","id":1483260,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODMyNjA=","avatar_url":"https://avatars2.githubusercontent.com/u/1483260?v=4","gravatar_id":"","url":"https://api.github.com/users/eggheads","html_url":"https://github.com/eggheads","followers_url":"https://api.github.com/users/eggheads/followers","following_url":"https://api.github.com/users/eggheads/following{/other_user}","gists_url":"https://api.github.com/users/eggheads/gists{/gist_id}","starred_url":"https://api.github.com/users/eggheads/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eggheads/subscriptions","organizations_url":"https://api.github.com/users/eggheads/orgs","repos_url":"https://api.github.com/users/eggheads/repos","events_url":"https://api.github.com/users/eggheads/events{/privacy}","received_events_url":"https://api.github.com/users/eggheads/received_events","type":"Organization","site_admin":false},"repo":{"id":44209137,"node_id":"MDEwOlJlcG9zaXRvcnk0NDIwOTEzNw==","name":"eggdrop","full_name":"eggheads/eggdrop","private":false,"owner":{"login":"eggheads","id":1483260,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODMyNjA=","avatar_url":"https://avatars2.githubusercontent.com/u/1483260?v=4","gravatar_id":"","url":"https://api.github.com/users/eggheads","html_url":"https://github.com/eggheads","followers_url":"https://api.github.com/users/eggheads/followers","following_url":"https://api.github.com/users/eggheads/following{/other_user}","gists_url":"https://api.github.com/users/eggheads/gists{/gist_id}","starred_url":"https://api.github.com/users/eggheads/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eggheads/subscriptions","organizations_url":"https://api.github.com/users/eggheads/orgs","repos_url":"https://api.github.com/users/eggheads/repos","events_url":"https://api.github.com/users/eggheads/events{/privacy}","received_events_url":"https://api.github.com/users/eggheads/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/eggheads/eggdrop","description":"The Eggdrop IRC Bot","fork":false,"url":"https://api.github.com/repos/eggheads/eggdrop","forks_url":"https://api.github.com/repos/eggheads/eggdrop/forks","keys_url":"https://api.github.com/repos/eggheads/eggdrop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eggheads/eggdrop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eggheads/eggdrop/teams","hooks_url":"https://api.github.com/repos/eggheads/eggdrop/hooks","issue_events_url":"https://api.github.com/repos/eggheads/eggdrop/issues/events{/number}","events_url":"https://api.github.com/repos/eggheads/eggdrop/events","assignees_url":"https://api.github.com/repos/eggheads/eggdrop/assignees{/user}","branches_url":"https://api.github.com/repos/eggheads/eggdrop/branches{/branch}","tags_url":"https://api.github.com/repos/eggheads/eggdrop/tags","blobs_url":"https://api.github.com/repos/eggheads/eggdrop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eggheads/eggdrop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eggheads/eggdrop/git/refs{/sha}","trees_url":"https://api.github.com/repos/eggheads/eggdrop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eggheads/eggdrop/statuses/{sha}","languages_url":"https://api.github.com/repos/eggheads/eggdrop/languages","stargazers_url":"https://api.github.com/repos/eggheads/eggdrop/stargazers","contributors_url":"https://api.github.com/repos/eggheads/eggdrop/contributors","subscribers_url":"https://api.github.com/repos/eggheads/eggdrop/subscribers","subscription_url":"https://api.github.com/repos/eggheads/eggdrop/subscription","commits_url":"https://api.github.com/repos/eggheads/eggdrop/commits{/sha}","git_commits_url":"https://api.github.com/repos/eggheads/eggdrop/git/commits{/sha}","comments_url":"https://api.github.com/repos/eggheads/eggdrop/comments{/number}","issue_comment_url":"https://api.github.com/repos/eggheads/eggdrop/issues/comments{/number}","contents_url":"https://api.github.com/repos/eggheads/eggdrop/contents/{+path}","compare_url":"https://api.github.com/repos/eggheads/eggdrop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eggheads/eggdrop/merges","archive_url":"https://api.github.com/repos/eggheads/eggdrop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eggheads/eggdrop/downloads","issues_url":"https://api.github.com/repos/eggheads/eggdrop/issues{/number}","pulls_url":"https://api.github.com/repos/eggheads/eggdrop/pulls{/number}","milestones_url":"https://api.github.com/repos/eggheads/eggdrop/milestones{/number}","notifications_url":"https://api.github.com/repos/eggheads/eggdrop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eggheads/eggdrop/labels{/name}","releases_url":"https://api.github.com/repos/eggheads/eggdrop/releases{/id}","deployments_url":"https://api.github.com/repos/eggheads/eggdrop/deployments","created_at":"2015-10-13T22:26:59Z","updated_at":"2018-10-23T23:25:36Z","pushed_at":"2018-10-24T04:06:05Z","git_url":"git://github.com/eggheads/eggdrop.git","ssh_url":"git@github.com:eggheads/eggdrop.git","clone_url":"https://github.com/eggheads/eggdrop.git","svn_url":"https://github.com/eggheads/eggdrop","homepage":null,"size":16200,"stargazers_count":183,"watchers_count":183,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":51,"mirror_url":null,"archived":false,"open_issues_count":171,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":51,"open_issues":171,"watchers":183,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/eggheads/eggdrop/pulls/702"},"html":{"href":"https://github.com/eggheads/eggdrop/pull/702"},"issue":{"href":"https://api.github.com/repos/eggheads/eggdrop/issues/702"},"comments":{"href":"https://api.github.com/repos/eggheads/eggdrop/issues/702/comments"},"review_comments":{"href":"https://api.github.com/repos/eggheads/eggdrop/pulls/702/comments"},"review_comment":{"href":"https://api.github.com/repos/eggheads/eggdrop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eggheads/eggdrop/pulls/702/commits"},"statuses":{"href":"https://api.github.com/repos/eggheads/eggdrop/statuses/f4894f0fc18c140e071361229567d0fd0dcb1fb2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Cizzle"}}