{"action":"created","comment":{"url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/comments/24398396","id":24398396,"diff_hunk":"@@ -89,9 +89,10 @@ int sc_asn1_read_tag(const u8 ** buf, size_t buflen, unsigned int *cla_out,\n \t\t\t * unsigned int */\n \t\t\treturn SC_ERROR_INVALID_ASN1_OBJECT;\n \n+\t} else {\n+\t\tif (left == 0)\n+\t\t\treturn SC_ERROR_INVALID_ASN1_OBJECT;\n \t}\n-\tif (left == 0)\n-\t\treturn SC_ERROR_INVALID_ASN1_OBJECT;\n \t/* parse length byte(s) */\n \tlen = *p & 0x7f;\n \tif (*p++ & 0x80) {","path":"src/libopensc/asn1.c","position":12,"original_position":12,"commit_id":"42820b2bba4360094108d6a76e6f707fc9e94a73","original_commit_id":"42820b2bba4360094108d6a76e6f707fc9e94a73","user":{"login":"frankmorgner","id":1266577,"avatar_url":"https://avatars.githubusercontent.com/u/1266577?v=3","gravatar_id":"","url":"https://api.github.com/users/frankmorgner","html_url":"https://github.com/frankmorgner","followers_url":"https://api.github.com/users/frankmorgner/followers","following_url":"https://api.github.com/users/frankmorgner/following{/other_user}","gists_url":"https://api.github.com/users/frankmorgner/gists{/gist_id}","starred_url":"https://api.github.com/users/frankmorgner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankmorgner/subscriptions","organizations_url":"https://api.github.com/users/frankmorgner/orgs","repos_url":"https://api.github.com/users/frankmorgner/repos","events_url":"https://api.github.com/users/frankmorgner/events{/privacy}","received_events_url":"https://api.github.com/users/frankmorgner/received_events","type":"User","site_admin":false},"body":"Both versions are semantically identical, see coverity scan CID 13628. It's hard to argue about the beauty of the code. I, personally, think that superfluous operations should be omitted.","created_at":"2015-02-10T09:21:28Z","updated_at":"2015-02-10T09:21:28Z","html_url":"https://github.com/OpenSC/OpenSC/pull/375#discussion_r24398396","pull_request_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/375","_links":{"self":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/comments/24398396"},"html":{"href":"https://github.com/OpenSC/OpenSC/pull/375#discussion_r24398396"},"pull_request":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/375"}}},"pull_request":{"url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/375","id":28962644,"html_url":"https://github.com/OpenSC/OpenSC/pull/375","diff_url":"https://github.com/OpenSC/OpenSC/pull/375.diff","patch_url":"https://github.com/OpenSC/OpenSC/pull/375.patch","issue_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/375","number":375,"state":"open","locked":false,"title":"Coverity","user":{"login":"frankmorgner","id":1266577,"avatar_url":"https://avatars.githubusercontent.com/u/1266577?v=3","gravatar_id":"","url":"https://api.github.com/users/frankmorgner","html_url":"https://github.com/frankmorgner","followers_url":"https://api.github.com/users/frankmorgner/followers","following_url":"https://api.github.com/users/frankmorgner/following{/other_user}","gists_url":"https://api.github.com/users/frankmorgner/gists{/gist_id}","starred_url":"https://api.github.com/users/frankmorgner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankmorgner/subscriptions","organizations_url":"https://api.github.com/users/frankmorgner/orgs","repos_url":"https://api.github.com/users/frankmorgner/repos","events_url":"https://api.github.com/users/frankmorgner/events{/privacy}","received_events_url":"https://api.github.com/users/frankmorgner/received_events","type":"User","site_admin":false},"body":"despite my expectations, some of the recent commits really got reviewed ;-) . So here is the next chunk of fixes.","created_at":"2015-02-09T22:26:00Z","updated_at":"2015-02-10T09:21:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc4d8f4fae062a8ad9af7bb951d326664e17e869","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/375/commits","review_comments_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/375/comments","review_comment_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/comments/{number}","comments_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/375/comments","statuses_url":"https://api.github.com/repos/OpenSC/OpenSC/statuses/42820b2bba4360094108d6a76e6f707fc9e94a73","head":{"label":"frankmorgner:coverity","ref":"coverity","sha":"42820b2bba4360094108d6a76e6f707fc9e94a73","user":{"login":"frankmorgner","id":1266577,"avatar_url":"https://avatars.githubusercontent.com/u/1266577?v=3","gravatar_id":"","url":"https://api.github.com/users/frankmorgner","html_url":"https://github.com/frankmorgner","followers_url":"https://api.github.com/users/frankmorgner/followers","following_url":"https://api.github.com/users/frankmorgner/following{/other_user}","gists_url":"https://api.github.com/users/frankmorgner/gists{/gist_id}","starred_url":"https://api.github.com/users/frankmorgner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankmorgner/subscriptions","organizations_url":"https://api.github.com/users/frankmorgner/orgs","repos_url":"https://api.github.com/users/frankmorgner/repos","events_url":"https://api.github.com/users/frankmorgner/events{/privacy}","received_events_url":"https://api.github.com/users/frankmorgner/received_events","type":"User","site_admin":false},"repo":{"id":3294055,"name":"OpenSC","full_name":"frankmorgner/OpenSC","owner":{"login":"frankmorgner","id":1266577,"avatar_url":"https://avatars.githubusercontent.com/u/1266577?v=3","gravatar_id":"","url":"https://api.github.com/users/frankmorgner","html_url":"https://github.com/frankmorgner","followers_url":"https://api.github.com/users/frankmorgner/followers","following_url":"https://api.github.com/users/frankmorgner/following{/other_user}","gists_url":"https://api.github.com/users/frankmorgner/gists{/gist_id}","starred_url":"https://api.github.com/users/frankmorgner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankmorgner/subscriptions","organizations_url":"https://api.github.com/users/frankmorgner/orgs","repos_url":"https://api.github.com/users/frankmorgner/repos","events_url":"https://api.github.com/users/frankmorgner/events{/privacy}","received_events_url":"https://api.github.com/users/frankmorgner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/frankmorgner/OpenSC","description":"Open source smart card tools and middleware. PKCS#11/MiniDriver/Tokend","fork":true,"url":"https://api.github.com/repos/frankmorgner/OpenSC","forks_url":"https://api.github.com/repos/frankmorgner/OpenSC/forks","keys_url":"https://api.github.com/repos/frankmorgner/OpenSC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/frankmorgner/OpenSC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/frankmorgner/OpenSC/teams","hooks_url":"https://api.github.com/repos/frankmorgner/OpenSC/hooks","issue_events_url":"https://api.github.com/repos/frankmorgner/OpenSC/issues/events{/number}","events_url":"https://api.github.com/repos/frankmorgner/OpenSC/events","assignees_url":"https://api.github.com/repos/frankmorgner/OpenSC/assignees{/user}","branches_url":"https://api.github.com/repos/frankmorgner/OpenSC/branches{/branch}","tags_url":"https://api.github.com/repos/frankmorgner/OpenSC/tags","blobs_url":"https://api.github.com/repos/frankmorgner/OpenSC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/frankmorgner/OpenSC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/frankmorgner/OpenSC/git/refs{/sha}","trees_url":"https://api.github.com/repos/frankmorgner/OpenSC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/frankmorgner/OpenSC/statuses/{sha}","languages_url":"https://api.github.com/repos/frankmorgner/OpenSC/languages","stargazers_url":"https://api.github.com/repos/frankmorgner/OpenSC/stargazers","contributors_url":"https://api.github.com/repos/frankmorgner/OpenSC/contributors","subscribers_url":"https://api.github.com/repos/frankmorgner/OpenSC/subscribers","subscription_url":"https://api.github.com/repos/frankmorgner/OpenSC/subscription","commits_url":"https://api.github.com/repos/frankmorgner/OpenSC/commits{/sha}","git_commits_url":"https://api.github.com/repos/frankmorgner/OpenSC/git/commits{/sha}","comments_url":"https://api.github.com/repos/frankmorgner/OpenSC/comments{/number}","issue_comment_url":"https://api.github.com/repos/frankmorgner/OpenSC/issues/comments/{number}","contents_url":"https://api.github.com/repos/frankmorgner/OpenSC/contents/{+path}","compare_url":"https://api.github.com/repos/frankmorgner/OpenSC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/frankmorgner/OpenSC/merges","archive_url":"https://api.github.com/repos/frankmorgner/OpenSC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/frankmorgner/OpenSC/downloads","issues_url":"https://api.github.com/repos/frankmorgner/OpenSC/issues{/number}","pulls_url":"https://api.github.com/repos/frankmorgner/OpenSC/pulls{/number}","milestones_url":"https://api.github.com/repos/frankmorgner/OpenSC/milestones{/number}","notifications_url":"https://api.github.com/repos/frankmorgner/OpenSC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/frankmorgner/OpenSC/labels{/name}","releases_url":"https://api.github.com/repos/frankmorgner/OpenSC/releases{/id}","created_at":"2012-01-28T23:08:53Z","updated_at":"2015-01-22T23:47:01Z","pushed_at":"2015-02-09T22:24:31Z","git_url":"git://github.com/frankmorgner/OpenSC.git","ssh_url":"git@github.com:frankmorgner/OpenSC.git","clone_url":"https://github.com/frankmorgner/OpenSC.git","svn_url":"https://github.com/frankmorgner/OpenSC","homepage":"https://www.opensc-project.org/","size":9522,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"OpenSC:master","ref":"master","sha":"3c1d8ad69557adf6aab08bc549188425c8b33a92","user":{"login":"OpenSC","id":895249,"avatar_url":"https://avatars.githubusercontent.com/u/895249?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenSC","html_url":"https://github.com/OpenSC","followers_url":"https://api.github.com/users/OpenSC/followers","following_url":"https://api.github.com/users/OpenSC/following{/other_user}","gists_url":"https://api.github.com/users/OpenSC/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSC/subscriptions","organizations_url":"https://api.github.com/users/OpenSC/orgs","repos_url":"https://api.github.com/users/OpenSC/repos","events_url":"https://api.github.com/users/OpenSC/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSC/received_events","type":"Organization","site_admin":false},"repo":{"id":1999692,"name":"OpenSC","full_name":"OpenSC/OpenSC","owner":{"login":"OpenSC","id":895249,"avatar_url":"https://avatars.githubusercontent.com/u/895249?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenSC","html_url":"https://github.com/OpenSC","followers_url":"https://api.github.com/users/OpenSC/followers","following_url":"https://api.github.com/users/OpenSC/following{/other_user}","gists_url":"https://api.github.com/users/OpenSC/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSC/subscriptions","organizations_url":"https://api.github.com/users/OpenSC/orgs","repos_url":"https://api.github.com/users/OpenSC/repos","events_url":"https://api.github.com/users/OpenSC/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenSC/OpenSC","description":"Open source smart card tools and middleware. PKCS#11/MiniDriver/Tokend","fork":false,"url":"https://api.github.com/repos/OpenSC/OpenSC","forks_url":"https://api.github.com/repos/OpenSC/OpenSC/forks","keys_url":"https://api.github.com/repos/OpenSC/OpenSC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenSC/OpenSC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenSC/OpenSC/teams","hooks_url":"https://api.github.com/repos/OpenSC/OpenSC/hooks","issue_events_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/events{/number}","events_url":"https://api.github.com/repos/OpenSC/OpenSC/events","assignees_url":"https://api.github.com/repos/OpenSC/OpenSC/assignees{/user}","branches_url":"https://api.github.com/repos/OpenSC/OpenSC/branches{/branch}","tags_url":"https://api.github.com/repos/OpenSC/OpenSC/tags","blobs_url":"https://api.github.com/repos/OpenSC/OpenSC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenSC/OpenSC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenSC/OpenSC/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenSC/OpenSC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenSC/OpenSC/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenSC/OpenSC/languages","stargazers_url":"https://api.github.com/repos/OpenSC/OpenSC/stargazers","contributors_url":"https://api.github.com/repos/OpenSC/OpenSC/contributors","subscribers_url":"https://api.github.com/repos/OpenSC/OpenSC/subscribers","subscription_url":"https://api.github.com/repos/OpenSC/OpenSC/subscription","commits_url":"https://api.github.com/repos/OpenSC/OpenSC/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenSC/OpenSC/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenSC/OpenSC/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/comments/{number}","contents_url":"https://api.github.com/repos/OpenSC/OpenSC/contents/{+path}","compare_url":"https://api.github.com/repos/OpenSC/OpenSC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenSC/OpenSC/merges","archive_url":"https://api.github.com/repos/OpenSC/OpenSC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenSC/OpenSC/downloads","issues_url":"https://api.github.com/repos/OpenSC/OpenSC/issues{/number}","pulls_url":"https://api.github.com/repos/OpenSC/OpenSC/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenSC/OpenSC/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenSC/OpenSC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenSC/OpenSC/labels{/name}","releases_url":"https://api.github.com/repos/OpenSC/OpenSC/releases{/id}","created_at":"2011-07-05T09:45:08Z","updated_at":"2015-02-09T14:33:57Z","pushed_at":"2015-02-07T20:47:31Z","git_url":"git://github.com/OpenSC/OpenSC.git","ssh_url":"git@github.com:OpenSC/OpenSC.git","clone_url":"https://github.com/OpenSC/OpenSC.git","svn_url":"https://github.com/OpenSC/OpenSC","homepage":"https://github.com/OpenSC/OpenSC/wiki","size":38591,"stargazers_count":224,"watchers_count":224,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":159,"mirror_url":null,"open_issues_count":29,"forks":159,"open_issues":29,"watchers":224,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/375"},"html":{"href":"https://github.com/OpenSC/OpenSC/pull/375"},"issue":{"href":"https://api.github.com/repos/OpenSC/OpenSC/issues/375"},"comments":{"href":"https://api.github.com/repos/OpenSC/OpenSC/issues/375/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/375/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/OpenSC/OpenSC/pulls/375/commits"},"statuses":{"href":"https://api.github.com/repos/OpenSC/OpenSC/statuses/42820b2bba4360094108d6a76e6f707fc9e94a73"}}}}