{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/52937505","id":52937505,"diff_hunk":"@@ -379,7 +380,119 @@ static void ConvertHostEntPlatformToPal(HostEntry& hostEntry, hostent& entry)\n     }\n }\n \n-#if HAVE_GETHOSTBYNAME_R\n+#if !HAVE_THREAD_SAFE_GETHOSTBYNAME_AND_GETHOSTBYADDR && (!HAVE_GETHOSTBYNAME_R && !HAVE_GETHOSTBYADDR_R)\n+#define BUFFER_OVERFLOW 255\n+static int copy_hostent(struct hostent* from, struct hostent* to,\n+                        char* buffer, size_t buflen, int* error)\n+{\n+    int i, len;\n+    char* ptr = buffer;\n+\n+    *error = 0;\n+    to->h_addrtype = from->h_addrtype;\n+    to->h_length = from->h_length;\n+    to->h_name = static_cast<char*>(ptr);\n+\n+    /* copy hostname to buffer */\n+    len = static_cast<int>(strlen(from->h_name)+1);\n+    SafeStringCopy(ptr, len, from->h_name);","path":"src/Native/System.Native/pal_networking.cpp","position":28,"original_position":28,"commit_id":"f076fb052366388af09374a8cd19a176c7978e76","original_commit_id":"f076fb052366388af09374a8cd19a176c7978e76","user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"body":"No, it's not how much space you need, but rather how much space exists, i.e. it should be ```buflen```.","created_at":"2016-02-15T19:48:27Z","updated_at":"2016-02-15T19:48:27Z","html_url":"https://github.com/dotnet/corefx/pull/6094#discussion_r52937505","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/6094","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/52937505"},"html":{"href":"https://github.com/dotnet/corefx/pull/6094#discussion_r52937505"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/6094"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/6094","id":59264738,"html_url":"https://github.com/dotnet/corefx/pull/6094","diff_url":"https://github.com/dotnet/corefx/pull/6094.diff","patch_url":"https://github.com/dotnet/corefx/pull/6094.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/6094","number":6094,"state":"open","locked":false,"title":"Add thread safe polyfill for gethostby[name/addr]_r","user":{"login":"jasonwilliams200OK","id":2031765,"avatar_url":"https://avatars.githubusercontent.com/u/2031765?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonwilliams200OK","html_url":"https://github.com/jasonwilliams200OK","followers_url":"https://api.github.com/users/jasonwilliams200OK/followers","following_url":"https://api.github.com/users/jasonwilliams200OK/following{/other_user}","gists_url":"https://api.github.com/users/jasonwilliams200OK/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonwilliams200OK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonwilliams200OK/subscriptions","organizations_url":"https://api.github.com/users/jasonwilliams200OK/orgs","repos_url":"https://api.github.com/users/jasonwilliams200OK/repos","events_url":"https://api.github.com/users/jasonwilliams200OK/events{/privacy}","received_events_url":"https://api.github.com/users/jasonwilliams200OK/received_events","type":"User","site_admin":false},"body":"NetBSD doesn't have `gethostby[name/addr]_r`. The sustitute\r\n`gethostby[name/addr]` are available. However, the non `_r` variants\r\nare unsafe.\r\n\r\nThis change adds two fallback functions to provide thread safe way of\r\ngetting host name and address.","created_at":"2016-02-13T10:57:07Z","updated_at":"2016-02-15T19:48:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f1cdc969fd93456f7648db9e964ab192f202f43","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/6094/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/6094/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/6094/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/f076fb052366388af09374a8cd19a176c7978e76","head":{"label":"jasonwilliams200OK:netbsd-patch-6","ref":"netbsd-patch-6","sha":"f076fb052366388af09374a8cd19a176c7978e76","user":{"login":"jasonwilliams200OK","id":2031765,"avatar_url":"https://avatars.githubusercontent.com/u/2031765?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonwilliams200OK","html_url":"https://github.com/jasonwilliams200OK","followers_url":"https://api.github.com/users/jasonwilliams200OK/followers","following_url":"https://api.github.com/users/jasonwilliams200OK/following{/other_user}","gists_url":"https://api.github.com/users/jasonwilliams200OK/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonwilliams200OK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonwilliams200OK/subscriptions","organizations_url":"https://api.github.com/users/jasonwilliams200OK/orgs","repos_url":"https://api.github.com/users/jasonwilliams200OK/repos","events_url":"https://api.github.com/users/jasonwilliams200OK/events{/privacy}","received_events_url":"https://api.github.com/users/jasonwilliams200OK/received_events","type":"User","site_admin":false},"repo":{"id":37428054,"name":"corefx","full_name":"jasonwilliams200OK/corefx","owner":{"login":"jasonwilliams200OK","id":2031765,"avatar_url":"https://avatars.githubusercontent.com/u/2031765?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonwilliams200OK","html_url":"https://github.com/jasonwilliams200OK","followers_url":"https://api.github.com/users/jasonwilliams200OK/followers","following_url":"https://api.github.com/users/jasonwilliams200OK/following{/other_user}","gists_url":"https://api.github.com/users/jasonwilliams200OK/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonwilliams200OK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonwilliams200OK/subscriptions","organizations_url":"https://api.github.com/users/jasonwilliams200OK/orgs","repos_url":"https://api.github.com/users/jasonwilliams200OK/repos","events_url":"https://api.github.com/users/jasonwilliams200OK/events{/privacy}","received_events_url":"https://api.github.com/users/jasonwilliams200OK/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jasonwilliams200OK/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":true,"url":"https://api.github.com/repos/jasonwilliams200OK/corefx","forks_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/forks","keys_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/teams","hooks_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/hooks","issue_events_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/events","assignees_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/tags","blobs_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/languages","stargazers_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/stargazers","contributors_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/contributors","subscribers_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/subscribers","subscription_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/subscription","commits_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/merges","archive_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/downloads","issues_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/labels{/name}","releases_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/jasonwilliams200OK/corefx/deployments","created_at":"2015-06-14T20:16:35Z","updated_at":"2015-06-14T20:16:54Z","pushed_at":"2016-02-14T10:49:28Z","git_url":"git://github.com/jasonwilliams200OK/corefx.git","ssh_url":"git@github.com:jasonwilliams200OK/corefx.git","clone_url":"https://github.com/jasonwilliams200OK/corefx.git","svn_url":"https://github.com/jasonwilliams200OK/corefx","homepage":"http://dotnet.github.io/core/","size":55634,"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":"dotnet:master","ref":"master","sha":"4221edbaa7f73562765b2732d965084a6684b589","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":26295345,"name":"corefx","full_name":"dotnet/corefx","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/corefx/deployments","created_at":"2014-11-06T23:42:48Z","updated_at":"2016-02-15T14:54:41Z","pushed_at":"2016-02-15T18:11:31Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"http://dotnet.github.io/","size":65647,"stargazers_count":9127,"watchers_count":9127,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2133,"mirror_url":null,"open_issues_count":822,"forks":2133,"open_issues":822,"watchers":9127,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/6094"},"html":{"href":"https://github.com/dotnet/corefx/pull/6094"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/6094"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/6094/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/6094/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/6094/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/f076fb052366388af09374a8cd19a176c7978e76"}}}}