{"action":"created","comment":{"url":"https://api.github.com/repos/radare/radare2/pulls/comments/60893766","id":60893766,"diff_hunk":"@@ -29,12 +29,23 @@ static void XREFKEY(char * const key, const size_t key_len,\n }\n \n R_API int r_anal_xrefs_load(RAnal *anal, const char *prjfile) {\n-\tchar *path, *db = r_str_newf (R2_HOMEDIR\"/projects/%s.d\", prjfile);\n+\t\tchar *path, *db;\n \tut8 found = 0;\n \tSdbListIter *it;\n \tSdbNs *ns;\n-\tif (!db) return false;\n-\tpath = r_str_home (db);\n+\n+\tif(!prjfile || strlen(prjfile) < 1) return false;","path":"libr/anal/xrefs.c","position":null,"original_position":12,"commit_id":"e340e1359da11176c8847e8d19f39eaac69c070a","original_commit_id":"5dd30abb2ea6602c772f8df8a606276f76639efc","user":{"login":"radare","id":917142,"avatar_url":"https://avatars.githubusercontent.com/u/917142?v=3","gravatar_id":"","url":"https://api.github.com/users/radare","html_url":"https://github.com/radare","followers_url":"https://api.github.com/users/radare/followers","following_url":"https://api.github.com/users/radare/following{/other_user}","gists_url":"https://api.github.com/users/radare/gists{/gist_id}","starred_url":"https://api.github.com/users/radare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radare/subscriptions","organizations_url":"https://api.github.com/users/radare/orgs","repos_url":"https://api.github.com/users/radare/repos","events_url":"https://api.github.com/users/radare/events{/privacy}","received_events_url":"https://api.github.com/users/radare/received_events","type":"User","site_admin":false},"body":"if strlen ()<1 it means strlen == 0, therefor the only thing you need to check here if the first char is not \\0, strlen is an unnecessary slowdown","created_at":"2016-04-25T10:38:56Z","updated_at":"2016-04-25T10:38:56Z","html_url":"https://github.com/radare/radare2/pull/4705#discussion_r60893766","pull_request_url":"https://api.github.com/repos/radare/radare2/pulls/4705","_links":{"self":{"href":"https://api.github.com/repos/radare/radare2/pulls/comments/60893766"},"html":{"href":"https://github.com/radare/radare2/pull/4705#discussion_r60893766"},"pull_request":{"href":"https://api.github.com/repos/radare/radare2/pulls/4705"}}},"pull_request":{"url":"https://api.github.com/repos/radare/radare2/pulls/4705","id":67695123,"html_url":"https://github.com/radare/radare2/pull/4705","diff_url":"https://github.com/radare/radare2/pull/4705.diff","patch_url":"https://github.com/radare/radare2/pull/4705.patch","issue_url":"https://api.github.com/repos/radare/radare2/issues/4705","number":4705,"state":"open","locked":false,"title":"Fix for #4697","user":{"login":"fabsx00","id":1379115,"avatar_url":"https://avatars.githubusercontent.com/u/1379115?v=3","gravatar_id":"","url":"https://api.github.com/users/fabsx00","html_url":"https://github.com/fabsx00","followers_url":"https://api.github.com/users/fabsx00/followers","following_url":"https://api.github.com/users/fabsx00/following{/other_user}","gists_url":"https://api.github.com/users/fabsx00/gists{/gist_id}","starred_url":"https://api.github.com/users/fabsx00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabsx00/subscriptions","organizations_url":"https://api.github.com/users/fabsx00/orgs","repos_url":"https://api.github.com/users/fabsx00/repos","events_url":"https://api.github.com/users/fabsx00/events{/privacy}","received_events_url":"https://api.github.com/users/fabsx00/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-25T10:12:54Z","updated_at":"2016-04-25T10:38:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7431dd46c9f330be1e5e790b3c70adec2bda6cc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/radare/radare2/pulls/4705/commits","review_comments_url":"https://api.github.com/repos/radare/radare2/pulls/4705/comments","review_comment_url":"https://api.github.com/repos/radare/radare2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/radare/radare2/issues/4705/comments","statuses_url":"https://api.github.com/repos/radare/radare2/statuses/e340e1359da11176c8847e8d19f39eaac69c070a","head":{"label":"fabsx00:master","ref":"master","sha":"e340e1359da11176c8847e8d19f39eaac69c070a","user":{"login":"fabsx00","id":1379115,"avatar_url":"https://avatars.githubusercontent.com/u/1379115?v=3","gravatar_id":"","url":"https://api.github.com/users/fabsx00","html_url":"https://github.com/fabsx00","followers_url":"https://api.github.com/users/fabsx00/followers","following_url":"https://api.github.com/users/fabsx00/following{/other_user}","gists_url":"https://api.github.com/users/fabsx00/gists{/gist_id}","starred_url":"https://api.github.com/users/fabsx00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabsx00/subscriptions","organizations_url":"https://api.github.com/users/fabsx00/orgs","repos_url":"https://api.github.com/users/fabsx00/repos","events_url":"https://api.github.com/users/fabsx00/events{/privacy}","received_events_url":"https://api.github.com/users/fabsx00/received_events","type":"User","site_admin":false},"repo":{"id":57031744,"name":"radare2","full_name":"fabsx00/radare2","owner":{"login":"fabsx00","id":1379115,"avatar_url":"https://avatars.githubusercontent.com/u/1379115?v=3","gravatar_id":"","url":"https://api.github.com/users/fabsx00","html_url":"https://github.com/fabsx00","followers_url":"https://api.github.com/users/fabsx00/followers","following_url":"https://api.github.com/users/fabsx00/following{/other_user}","gists_url":"https://api.github.com/users/fabsx00/gists{/gist_id}","starred_url":"https://api.github.com/users/fabsx00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabsx00/subscriptions","organizations_url":"https://api.github.com/users/fabsx00/orgs","repos_url":"https://api.github.com/users/fabsx00/repos","events_url":"https://api.github.com/users/fabsx00/events{/privacy}","received_events_url":"https://api.github.com/users/fabsx00/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fabsx00/radare2","description":"unix-like reverse engineering framework and commandline tools","fork":true,"url":"https://api.github.com/repos/fabsx00/radare2","forks_url":"https://api.github.com/repos/fabsx00/radare2/forks","keys_url":"https://api.github.com/repos/fabsx00/radare2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabsx00/radare2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabsx00/radare2/teams","hooks_url":"https://api.github.com/repos/fabsx00/radare2/hooks","issue_events_url":"https://api.github.com/repos/fabsx00/radare2/issues/events{/number}","events_url":"https://api.github.com/repos/fabsx00/radare2/events","assignees_url":"https://api.github.com/repos/fabsx00/radare2/assignees{/user}","branches_url":"https://api.github.com/repos/fabsx00/radare2/branches{/branch}","tags_url":"https://api.github.com/repos/fabsx00/radare2/tags","blobs_url":"https://api.github.com/repos/fabsx00/radare2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabsx00/radare2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabsx00/radare2/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabsx00/radare2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabsx00/radare2/statuses/{sha}","languages_url":"https://api.github.com/repos/fabsx00/radare2/languages","stargazers_url":"https://api.github.com/repos/fabsx00/radare2/stargazers","contributors_url":"https://api.github.com/repos/fabsx00/radare2/contributors","subscribers_url":"https://api.github.com/repos/fabsx00/radare2/subscribers","subscription_url":"https://api.github.com/repos/fabsx00/radare2/subscription","commits_url":"https://api.github.com/repos/fabsx00/radare2/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabsx00/radare2/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabsx00/radare2/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabsx00/radare2/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabsx00/radare2/contents/{+path}","compare_url":"https://api.github.com/repos/fabsx00/radare2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabsx00/radare2/merges","archive_url":"https://api.github.com/repos/fabsx00/radare2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabsx00/radare2/downloads","issues_url":"https://api.github.com/repos/fabsx00/radare2/issues{/number}","pulls_url":"https://api.github.com/repos/fabsx00/radare2/pulls{/number}","milestones_url":"https://api.github.com/repos/fabsx00/radare2/milestones{/number}","notifications_url":"https://api.github.com/repos/fabsx00/radare2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabsx00/radare2/labels{/name}","releases_url":"https://api.github.com/repos/fabsx00/radare2/releases{/id}","deployments_url":"https://api.github.com/repos/fabsx00/radare2/deployments","created_at":"2016-04-25T10:05:46Z","updated_at":"2016-04-25T10:05:58Z","pushed_at":"2016-04-25T10:36:56Z","git_url":"git://github.com/fabsx00/radare2.git","ssh_url":"git@github.com:fabsx00/radare2.git","clone_url":"https://github.com/fabsx00/radare2.git","svn_url":"https://github.com/fabsx00/radare2","homepage":"http://www.radare.org/","size":57242,"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":"radare:master","ref":"master","sha":"b88f1d63f5ba71b841b9d3b405c683b07569d894","user":{"login":"radare","id":917142,"avatar_url":"https://avatars.githubusercontent.com/u/917142?v=3","gravatar_id":"","url":"https://api.github.com/users/radare","html_url":"https://github.com/radare","followers_url":"https://api.github.com/users/radare/followers","following_url":"https://api.github.com/users/radare/following{/other_user}","gists_url":"https://api.github.com/users/radare/gists{/gist_id}","starred_url":"https://api.github.com/users/radare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radare/subscriptions","organizations_url":"https://api.github.com/users/radare/orgs","repos_url":"https://api.github.com/users/radare/repos","events_url":"https://api.github.com/users/radare/events{/privacy}","received_events_url":"https://api.github.com/users/radare/received_events","type":"User","site_admin":false},"repo":{"id":4869294,"name":"radare2","full_name":"radare/radare2","owner":{"login":"radare","id":917142,"avatar_url":"https://avatars.githubusercontent.com/u/917142?v=3","gravatar_id":"","url":"https://api.github.com/users/radare","html_url":"https://github.com/radare","followers_url":"https://api.github.com/users/radare/followers","following_url":"https://api.github.com/users/radare/following{/other_user}","gists_url":"https://api.github.com/users/radare/gists{/gist_id}","starred_url":"https://api.github.com/users/radare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radare/subscriptions","organizations_url":"https://api.github.com/users/radare/orgs","repos_url":"https://api.github.com/users/radare/repos","events_url":"https://api.github.com/users/radare/events{/privacy}","received_events_url":"https://api.github.com/users/radare/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/radare/radare2","description":"unix-like reverse engineering framework and commandline tools","fork":false,"url":"https://api.github.com/repos/radare/radare2","forks_url":"https://api.github.com/repos/radare/radare2/forks","keys_url":"https://api.github.com/repos/radare/radare2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/radare/radare2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/radare/radare2/teams","hooks_url":"https://api.github.com/repos/radare/radare2/hooks","issue_events_url":"https://api.github.com/repos/radare/radare2/issues/events{/number}","events_url":"https://api.github.com/repos/radare/radare2/events","assignees_url":"https://api.github.com/repos/radare/radare2/assignees{/user}","branches_url":"https://api.github.com/repos/radare/radare2/branches{/branch}","tags_url":"https://api.github.com/repos/radare/radare2/tags","blobs_url":"https://api.github.com/repos/radare/radare2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/radare/radare2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/radare/radare2/git/refs{/sha}","trees_url":"https://api.github.com/repos/radare/radare2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/radare/radare2/statuses/{sha}","languages_url":"https://api.github.com/repos/radare/radare2/languages","stargazers_url":"https://api.github.com/repos/radare/radare2/stargazers","contributors_url":"https://api.github.com/repos/radare/radare2/contributors","subscribers_url":"https://api.github.com/repos/radare/radare2/subscribers","subscription_url":"https://api.github.com/repos/radare/radare2/subscription","commits_url":"https://api.github.com/repos/radare/radare2/commits{/sha}","git_commits_url":"https://api.github.com/repos/radare/radare2/git/commits{/sha}","comments_url":"https://api.github.com/repos/radare/radare2/comments{/number}","issue_comment_url":"https://api.github.com/repos/radare/radare2/issues/comments{/number}","contents_url":"https://api.github.com/repos/radare/radare2/contents/{+path}","compare_url":"https://api.github.com/repos/radare/radare2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/radare/radare2/merges","archive_url":"https://api.github.com/repos/radare/radare2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/radare/radare2/downloads","issues_url":"https://api.github.com/repos/radare/radare2/issues{/number}","pulls_url":"https://api.github.com/repos/radare/radare2/pulls{/number}","milestones_url":"https://api.github.com/repos/radare/radare2/milestones{/number}","notifications_url":"https://api.github.com/repos/radare/radare2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/radare/radare2/labels{/name}","releases_url":"https://api.github.com/repos/radare/radare2/releases{/id}","deployments_url":"https://api.github.com/repos/radare/radare2/deployments","created_at":"2012-07-03T07:42:26Z","updated_at":"2016-04-25T07:41:17Z","pushed_at":"2016-04-25T10:36:57Z","git_url":"git://github.com/radare/radare2.git","ssh_url":"git@github.com:radare/radare2.git","clone_url":"https://github.com/radare/radare2.git","svn_url":"https://github.com/radare/radare2","homepage":"http://www.radare.org/","size":73600,"stargazers_count":2552,"watchers_count":2552,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":566,"mirror_url":null,"open_issues_count":710,"forks":566,"open_issues":710,"watchers":2552,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/radare/radare2/pulls/4705"},"html":{"href":"https://github.com/radare/radare2/pull/4705"},"issue":{"href":"https://api.github.com/repos/radare/radare2/issues/4705"},"comments":{"href":"https://api.github.com/repos/radare/radare2/issues/4705/comments"},"review_comments":{"href":"https://api.github.com/repos/radare/radare2/pulls/4705/comments"},"review_comment":{"href":"https://api.github.com/repos/radare/radare2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/radare/radare2/pulls/4705/commits"},"statuses":{"href":"https://api.github.com/repos/radare/radare2/statuses/e340e1359da11176c8847e8d19f39eaac69c070a"}}}}