{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/60577071","id":60577071,"diff_hunk":"@@ -530,6 +530,9 @@ func (daemon *Daemon) newContainer(name string, config *containertypes.Config, i\n \n // GetByName returns a container given a name.\n func (daemon *Daemon) GetByName(name string) (*container.Container, error) {\n+\tif len(name) == 0 {\n+\t\treturn nil, fmt.Errorf(\"Could not find entity for empty container name\")","path":"daemon/daemon.go","position":5,"original_position":5,"commit_id":"e8bf6aa8415cef022ecb3614fee0e903b104943f","original_commit_id":"e8bf6aa8415cef022ecb3614fee0e903b104943f","user":{"login":"cpuguy83","id":799078,"avatar_url":"https://avatars.githubusercontent.com/u/799078?v=3","gravatar_id":"","url":"https://api.github.com/users/cpuguy83","html_url":"https://github.com/cpuguy83","followers_url":"https://api.github.com/users/cpuguy83/followers","following_url":"https://api.github.com/users/cpuguy83/following{/other_user}","gists_url":"https://api.github.com/users/cpuguy83/gists{/gist_id}","starred_url":"https://api.github.com/users/cpuguy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpuguy83/subscriptions","organizations_url":"https://api.github.com/users/cpuguy83/orgs","repos_url":"https://api.github.com/users/cpuguy83/repos","events_url":"https://api.github.com/users/cpuguy83/events{/privacy}","received_events_url":"https://api.github.com/users/cpuguy83/received_events","type":"User","site_admin":false},"body":"Can you use `errors.NewBadRequestError` here. This will ensure the proper HTTP handling.\r\nMaybe improve the error message with `No container name or ID supplied`.","created_at":"2016-04-21T13:17:15Z","updated_at":"2016-04-21T13:17:15Z","html_url":"https://github.com/docker/docker/pull/22213#discussion_r60577071","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/22213","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/60577071"},"html":{"href":"https://github.com/docker/docker/pull/22213#discussion_r60577071"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/22213"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/22213","id":67284410,"html_url":"https://github.com/docker/docker/pull/22213","diff_url":"https://github.com/docker/docker/pull/22213.diff","patch_url":"https://github.com/docker/docker/pull/22213.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/22213","number":22213,"state":"open","locked":false,"title":"Docker http panics caused by container deletion with empty names.","user":{"login":"yongtang","id":6932348,"avatar_url":"https://avatars.githubusercontent.com/u/6932348?v=3","gravatar_id":"","url":"https://api.github.com/users/yongtang","html_url":"https://github.com/yongtang","followers_url":"https://api.github.com/users/yongtang/followers","following_url":"https://api.github.com/users/yongtang/following{/other_user}","gists_url":"https://api.github.com/users/yongtang/gists{/gist_id}","starred_url":"https://api.github.com/users/yongtang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongtang/subscriptions","organizations_url":"https://api.github.com/users/yongtang/orgs","repos_url":"https://api.github.com/users/yongtang/repos","events_url":"https://api.github.com/users/yongtang/events{/privacy}","received_events_url":"https://api.github.com/users/yongtang/received_events","type":"User","site_admin":false},"body":"**- What I did**\r\n\r\nThis fix tries to fix the http panics caused by container deletion with empty names in #22210.\r\n\r\n**- How I did it**\r\n\r\nThe issue was because when an empty string was passed, `GetByName()` tried to access the first element of the name string without checking the length. A length check has been added.\r\n\r\n**- How to verify it**\r\n\r\nA test case for #22210 has been added.\r\n\r\n**- A picture of a cute animal (not mandatory but encouraged)**\r\n\r\nThis fix fixes #22210.\r\n\r\nSigned-off-by: Yong Tang <yong.tang.github@outlook.com>","created_at":"2016-04-21T01:39:18Z","updated_at":"2016-04-21T13:17:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59b3fd9f6f3dc6a5560070710ecaacfbacb4bcc2","assignee":null,"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/54","html_url":"https://github.com/docker/docker/milestones/1.11.1","labels_url":"https://api.github.com/repos/docker/docker/milestones/54/labels","id":1705023,"number":54,"title":"1.11.1","description":"","creator":{"login":"tiborvass","id":827131,"avatar_url":"https://avatars.githubusercontent.com/u/827131?v=3","gravatar_id":"","url":"https://api.github.com/users/tiborvass","html_url":"https://github.com/tiborvass","followers_url":"https://api.github.com/users/tiborvass/followers","following_url":"https://api.github.com/users/tiborvass/following{/other_user}","gists_url":"https://api.github.com/users/tiborvass/gists{/gist_id}","starred_url":"https://api.github.com/users/tiborvass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiborvass/subscriptions","organizations_url":"https://api.github.com/users/tiborvass/orgs","repos_url":"https://api.github.com/users/tiborvass/repos","events_url":"https://api.github.com/users/tiborvass/events{/privacy}","received_events_url":"https://api.github.com/users/tiborvass/received_events","type":"User","site_admin":false},"open_issues":24,"closed_issues":17,"state":"open","created_at":"2016-04-14T01:56:12Z","updated_at":"2016-04-21T12:51:10Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/docker/docker/pulls/22213/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/22213/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/22213/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/e8bf6aa8415cef022ecb3614fee0e903b104943f","head":{"label":"yongtang:22210-docker-http-panics","ref":"22210-docker-http-panics","sha":"e8bf6aa8415cef022ecb3614fee0e903b104943f","user":{"login":"yongtang","id":6932348,"avatar_url":"https://avatars.githubusercontent.com/u/6932348?v=3","gravatar_id":"","url":"https://api.github.com/users/yongtang","html_url":"https://github.com/yongtang","followers_url":"https://api.github.com/users/yongtang/followers","following_url":"https://api.github.com/users/yongtang/following{/other_user}","gists_url":"https://api.github.com/users/yongtang/gists{/gist_id}","starred_url":"https://api.github.com/users/yongtang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongtang/subscriptions","organizations_url":"https://api.github.com/users/yongtang/orgs","repos_url":"https://api.github.com/users/yongtang/repos","events_url":"https://api.github.com/users/yongtang/events{/privacy}","received_events_url":"https://api.github.com/users/yongtang/received_events","type":"User","site_admin":false},"repo":{"id":53518876,"name":"docker","full_name":"yongtang/docker","owner":{"login":"yongtang","id":6932348,"avatar_url":"https://avatars.githubusercontent.com/u/6932348?v=3","gravatar_id":"","url":"https://api.github.com/users/yongtang","html_url":"https://github.com/yongtang","followers_url":"https://api.github.com/users/yongtang/followers","following_url":"https://api.github.com/users/yongtang/following{/other_user}","gists_url":"https://api.github.com/users/yongtang/gists{/gist_id}","starred_url":"https://api.github.com/users/yongtang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongtang/subscriptions","organizations_url":"https://api.github.com/users/yongtang/orgs","repos_url":"https://api.github.com/users/yongtang/repos","events_url":"https://api.github.com/users/yongtang/events{/privacy}","received_events_url":"https://api.github.com/users/yongtang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yongtang/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/yongtang/docker","forks_url":"https://api.github.com/repos/yongtang/docker/forks","keys_url":"https://api.github.com/repos/yongtang/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yongtang/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yongtang/docker/teams","hooks_url":"https://api.github.com/repos/yongtang/docker/hooks","issue_events_url":"https://api.github.com/repos/yongtang/docker/issues/events{/number}","events_url":"https://api.github.com/repos/yongtang/docker/events","assignees_url":"https://api.github.com/repos/yongtang/docker/assignees{/user}","branches_url":"https://api.github.com/repos/yongtang/docker/branches{/branch}","tags_url":"https://api.github.com/repos/yongtang/docker/tags","blobs_url":"https://api.github.com/repos/yongtang/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yongtang/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yongtang/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/yongtang/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yongtang/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/yongtang/docker/languages","stargazers_url":"https://api.github.com/repos/yongtang/docker/stargazers","contributors_url":"https://api.github.com/repos/yongtang/docker/contributors","subscribers_url":"https://api.github.com/repos/yongtang/docker/subscribers","subscription_url":"https://api.github.com/repos/yongtang/docker/subscription","commits_url":"https://api.github.com/repos/yongtang/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/yongtang/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/yongtang/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/yongtang/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/yongtang/docker/contents/{+path}","compare_url":"https://api.github.com/repos/yongtang/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yongtang/docker/merges","archive_url":"https://api.github.com/repos/yongtang/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yongtang/docker/downloads","issues_url":"https://api.github.com/repos/yongtang/docker/issues{/number}","pulls_url":"https://api.github.com/repos/yongtang/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/yongtang/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/yongtang/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yongtang/docker/labels{/name}","releases_url":"https://api.github.com/repos/yongtang/docker/releases{/id}","deployments_url":"https://api.github.com/repos/yongtang/docker/deployments","created_at":"2016-03-09T17:51:45Z","updated_at":"2016-03-09T17:51:56Z","pushed_at":"2016-04-21T01:37:52Z","git_url":"git://github.com/yongtang/docker.git","ssh_url":"git@github.com:yongtang/docker.git","clone_url":"https://github.com/yongtang/docker.git","svn_url":"https://github.com/yongtang/docker","homepage":"http://www.docker.com","size":88538,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"docker:master","ref":"master","sha":"ccf83c94d18df4b27ca3d46ffbe008df76aa3275","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","deployments_url":"https://api.github.com/repos/docker/docker/deployments","created_at":"2013-01-18T18:10:57Z","updated_at":"2016-04-21T12:46:18Z","pushed_at":"2016-04-21T11:37:28Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":197997,"stargazers_count":30618,"watchers_count":30618,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8683,"mirror_url":null,"open_issues_count":1516,"forks":8683,"open_issues":1516,"watchers":30618,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/22213"},"html":{"href":"https://github.com/docker/docker/pull/22213"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/22213"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/22213/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/22213/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/22213/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/e8bf6aa8415cef022ecb3614fee0e903b104943f"}}}}