{"action":"created","comment":{"url":"https://api.github.com/repos/vapor/vapor/pulls/comments/87436931","pull_request_review_id":8050636,"id":87436931,"diff_hunk":"@@ -41,7 +41,10 @@ extension Collection where Iterator.Element == Byte, IndexDistance == Int, Index\n             if pos < ranges.count - 1 {\n                 // Take the data inbetween this and the next boundry\n                 let nextRange = ranges[pos + 1]\n-\n+                // Skip if there is no content\n+                if range.to > nextRange.from {","path":"Sources/Vapor/Utilities/Byte/Data.swift","position":6,"original_position":6,"commit_id":"7ee9fa6aeb83e4bd51adb1c5496ebaddab201a2b","original_commit_id":"7ee9fa6aeb83e4bd51adb1c5496ebaddab201a2b","user":{"login":"LoganWright","id":5750489,"avatar_url":"https://avatars.githubusercontent.com/u/5750489?v=3","gravatar_id":"","url":"https://api.github.com/users/LoganWright","html_url":"https://github.com/LoganWright","followers_url":"https://api.github.com/users/LoganWright/followers","following_url":"https://api.github.com/users/LoganWright/following{/other_user}","gists_url":"https://api.github.com/users/LoganWright/gists{/gist_id}","starred_url":"https://api.github.com/users/LoganWright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LoganWright/subscriptions","organizations_url":"https://api.github.com/users/LoganWright/orgs","repos_url":"https://api.github.com/users/LoganWright/repos","events_url":"https://api.github.com/users/LoganWright/events{/privacy}","received_events_url":"https://api.github.com/users/LoganWright/received_events","type":"User","site_admin":false},"body":"Should this be a break or do we need to continue loop.\r\n\r\nFollow up, I think since we're breaking scope, it'd read better as a guard here 👍 ","created_at":"2016-11-10T16:54:43Z","updated_at":"2016-11-10T17:01:04Z","html_url":"https://github.com/vapor/vapor/pull/696#discussion_r87436931","pull_request_url":"https://api.github.com/repos/vapor/vapor/pulls/696","_links":{"self":{"href":"https://api.github.com/repos/vapor/vapor/pulls/comments/87436931"},"html":{"href":"https://github.com/vapor/vapor/pull/696#discussion_r87436931"},"pull_request":{"href":"https://api.github.com/repos/vapor/vapor/pulls/696"}}},"pull_request":{"url":"https://api.github.com/repos/vapor/vapor/pulls/696","id":93077457,"html_url":"https://github.com/vapor/vapor/pull/696","diff_url":"https://github.com/vapor/vapor/pull/696.diff","patch_url":"https://github.com/vapor/vapor/pull/696.patch","issue_url":"https://api.github.com/repos/vapor/vapor/issues/696","number":696,"state":"open","locked":false,"title":"Fix a crash where parsing a Multipart with empty content","user":{"login":"bygri","id":5916645,"avatar_url":"https://avatars.githubusercontent.com/u/5916645?v=3","gravatar_id":"","url":"https://api.github.com/users/bygri","html_url":"https://github.com/bygri","followers_url":"https://api.github.com/users/bygri/followers","following_url":"https://api.github.com/users/bygri/following{/other_user}","gists_url":"https://api.github.com/users/bygri/gists{/gist_id}","starred_url":"https://api.github.com/users/bygri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bygri/subscriptions","organizations_url":"https://api.github.com/users/bygri/orgs","repos_url":"https://api.github.com/users/bygri/repos","events_url":"https://api.github.com/users/bygri/events{/privacy}","received_events_url":"https://api.github.com/users/bygri/received_events","type":"User","site_admin":false},"body":"Reported in Slack, a crash when parsing this body:\r\n\r\n```\r\n------WebKitFormBoundaryUIJNcsyK0GGA6kOU\r\nContent-Disposition: form-data; name=\"xib\"; filename=\"\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n------WebKitFormBoundaryUIJNcsyK0GGA6kOU\r\nContent-Disposition: form-data; name=\"ajax\"\r\n\r\n1\r\n------WebKitFormBoundaryUIJNcsyK0GGA6kOU\r\nContent-Disposition: form-data; name=\"xib\"; filename=\"AlarmSettings.xib\"\r\nContent-Type: application/octet-stream\r\n\r\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n....SNIP...\r\n------WebKitFormBoundaryUIJNcsyK0GGA6kOU———\r\n```\r\n\r\nThe crash was caused by the first part, which was created by an HTML `file` input which had been left empty. Vapor crashed on line 45 of Vapor/Utilities/Byte/Data.swift trying to make a range where the lower bound was greater than the upper bound.\r\n\r\nI've simply put in a conditional that stops that from happening, and causes an empty part to be ignored. There may be a better solution but this stops the crash.","created_at":"2016-11-10T02:41:03Z","updated_at":"2016-11-10T17:01:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63ddc256d86b776d27e7eac3463f6a63eb127373","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/vapor/vapor/pulls/696/commits","review_comments_url":"https://api.github.com/repos/vapor/vapor/pulls/696/comments","review_comment_url":"https://api.github.com/repos/vapor/vapor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vapor/vapor/issues/696/comments","statuses_url":"https://api.github.com/repos/vapor/vapor/statuses/7ee9fa6aeb83e4bd51adb1c5496ebaddab201a2b","head":{"label":"bygri:multipart-duplicatename-crash","ref":"multipart-duplicatename-crash","sha":"7ee9fa6aeb83e4bd51adb1c5496ebaddab201a2b","user":{"login":"bygri","id":5916645,"avatar_url":"https://avatars.githubusercontent.com/u/5916645?v=3","gravatar_id":"","url":"https://api.github.com/users/bygri","html_url":"https://github.com/bygri","followers_url":"https://api.github.com/users/bygri/followers","following_url":"https://api.github.com/users/bygri/following{/other_user}","gists_url":"https://api.github.com/users/bygri/gists{/gist_id}","starred_url":"https://api.github.com/users/bygri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bygri/subscriptions","organizations_url":"https://api.github.com/users/bygri/orgs","repos_url":"https://api.github.com/users/bygri/repos","events_url":"https://api.github.com/users/bygri/events{/privacy}","received_events_url":"https://api.github.com/users/bygri/received_events","type":"User","site_admin":false},"repo":{"id":73337898,"name":"vapor","full_name":"bygri/vapor","owner":{"login":"bygri","id":5916645,"avatar_url":"https://avatars.githubusercontent.com/u/5916645?v=3","gravatar_id":"","url":"https://api.github.com/users/bygri","html_url":"https://github.com/bygri","followers_url":"https://api.github.com/users/bygri/followers","following_url":"https://api.github.com/users/bygri/following{/other_user}","gists_url":"https://api.github.com/users/bygri/gists{/gist_id}","starred_url":"https://api.github.com/users/bygri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bygri/subscriptions","organizations_url":"https://api.github.com/users/bygri/orgs","repos_url":"https://api.github.com/users/bygri/repos","events_url":"https://api.github.com/users/bygri/events{/privacy}","received_events_url":"https://api.github.com/users/bygri/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bygri/vapor","description":"A web framework and server for Swift that works on macOS and Ubuntu.","fork":true,"url":"https://api.github.com/repos/bygri/vapor","forks_url":"https://api.github.com/repos/bygri/vapor/forks","keys_url":"https://api.github.com/repos/bygri/vapor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bygri/vapor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bygri/vapor/teams","hooks_url":"https://api.github.com/repos/bygri/vapor/hooks","issue_events_url":"https://api.github.com/repos/bygri/vapor/issues/events{/number}","events_url":"https://api.github.com/repos/bygri/vapor/events","assignees_url":"https://api.github.com/repos/bygri/vapor/assignees{/user}","branches_url":"https://api.github.com/repos/bygri/vapor/branches{/branch}","tags_url":"https://api.github.com/repos/bygri/vapor/tags","blobs_url":"https://api.github.com/repos/bygri/vapor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bygri/vapor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bygri/vapor/git/refs{/sha}","trees_url":"https://api.github.com/repos/bygri/vapor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bygri/vapor/statuses/{sha}","languages_url":"https://api.github.com/repos/bygri/vapor/languages","stargazers_url":"https://api.github.com/repos/bygri/vapor/stargazers","contributors_url":"https://api.github.com/repos/bygri/vapor/contributors","subscribers_url":"https://api.github.com/repos/bygri/vapor/subscribers","subscription_url":"https://api.github.com/repos/bygri/vapor/subscription","commits_url":"https://api.github.com/repos/bygri/vapor/commits{/sha}","git_commits_url":"https://api.github.com/repos/bygri/vapor/git/commits{/sha}","comments_url":"https://api.github.com/repos/bygri/vapor/comments{/number}","issue_comment_url":"https://api.github.com/repos/bygri/vapor/issues/comments{/number}","contents_url":"https://api.github.com/repos/bygri/vapor/contents/{+path}","compare_url":"https://api.github.com/repos/bygri/vapor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bygri/vapor/merges","archive_url":"https://api.github.com/repos/bygri/vapor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bygri/vapor/downloads","issues_url":"https://api.github.com/repos/bygri/vapor/issues{/number}","pulls_url":"https://api.github.com/repos/bygri/vapor/pulls{/number}","milestones_url":"https://api.github.com/repos/bygri/vapor/milestones{/number}","notifications_url":"https://api.github.com/repos/bygri/vapor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bygri/vapor/labels{/name}","releases_url":"https://api.github.com/repos/bygri/vapor/releases{/id}","deployments_url":"https://api.github.com/repos/bygri/vapor/deployments","created_at":"2016-11-10T01:56:24Z","updated_at":"2016-11-10T01:56:26Z","pushed_at":"2016-11-10T02:36:12Z","git_url":"git://github.com/bygri/vapor.git","ssh_url":"git@github.com:bygri/vapor.git","clone_url":"https://github.com/bygri/vapor.git","svn_url":"https://github.com/bygri/vapor","homepage":"https://vapor.codes","size":8596,"stargazers_count":0,"watchers_count":0,"language":"Swift","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":"vapor:master","ref":"master","sha":"fced1779ec56fe46879ede1c58e88316e854a973","user":{"login":"vapor","id":17364220,"avatar_url":"https://avatars.githubusercontent.com/u/17364220?v=3","gravatar_id":"","url":"https://api.github.com/users/vapor","html_url":"https://github.com/vapor","followers_url":"https://api.github.com/users/vapor/followers","following_url":"https://api.github.com/users/vapor/following{/other_user}","gists_url":"https://api.github.com/users/vapor/gists{/gist_id}","starred_url":"https://api.github.com/users/vapor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vapor/subscriptions","organizations_url":"https://api.github.com/users/vapor/orgs","repos_url":"https://api.github.com/users/vapor/repos","events_url":"https://api.github.com/users/vapor/events{/privacy}","received_events_url":"https://api.github.com/users/vapor/received_events","type":"Organization","site_admin":false},"repo":{"id":49910095,"name":"vapor","full_name":"vapor/vapor","owner":{"login":"vapor","id":17364220,"avatar_url":"https://avatars.githubusercontent.com/u/17364220?v=3","gravatar_id":"","url":"https://api.github.com/users/vapor","html_url":"https://github.com/vapor","followers_url":"https://api.github.com/users/vapor/followers","following_url":"https://api.github.com/users/vapor/following{/other_user}","gists_url":"https://api.github.com/users/vapor/gists{/gist_id}","starred_url":"https://api.github.com/users/vapor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vapor/subscriptions","organizations_url":"https://api.github.com/users/vapor/orgs","repos_url":"https://api.github.com/users/vapor/repos","events_url":"https://api.github.com/users/vapor/events{/privacy}","received_events_url":"https://api.github.com/users/vapor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vapor/vapor","description":"A web framework and server for Swift that works on macOS and Ubuntu.","fork":false,"url":"https://api.github.com/repos/vapor/vapor","forks_url":"https://api.github.com/repos/vapor/vapor/forks","keys_url":"https://api.github.com/repos/vapor/vapor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vapor/vapor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vapor/vapor/teams","hooks_url":"https://api.github.com/repos/vapor/vapor/hooks","issue_events_url":"https://api.github.com/repos/vapor/vapor/issues/events{/number}","events_url":"https://api.github.com/repos/vapor/vapor/events","assignees_url":"https://api.github.com/repos/vapor/vapor/assignees{/user}","branches_url":"https://api.github.com/repos/vapor/vapor/branches{/branch}","tags_url":"https://api.github.com/repos/vapor/vapor/tags","blobs_url":"https://api.github.com/repos/vapor/vapor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vapor/vapor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vapor/vapor/git/refs{/sha}","trees_url":"https://api.github.com/repos/vapor/vapor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vapor/vapor/statuses/{sha}","languages_url":"https://api.github.com/repos/vapor/vapor/languages","stargazers_url":"https://api.github.com/repos/vapor/vapor/stargazers","contributors_url":"https://api.github.com/repos/vapor/vapor/contributors","subscribers_url":"https://api.github.com/repos/vapor/vapor/subscribers","subscription_url":"https://api.github.com/repos/vapor/vapor/subscription","commits_url":"https://api.github.com/repos/vapor/vapor/commits{/sha}","git_commits_url":"https://api.github.com/repos/vapor/vapor/git/commits{/sha}","comments_url":"https://api.github.com/repos/vapor/vapor/comments{/number}","issue_comment_url":"https://api.github.com/repos/vapor/vapor/issues/comments{/number}","contents_url":"https://api.github.com/repos/vapor/vapor/contents/{+path}","compare_url":"https://api.github.com/repos/vapor/vapor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vapor/vapor/merges","archive_url":"https://api.github.com/repos/vapor/vapor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vapor/vapor/downloads","issues_url":"https://api.github.com/repos/vapor/vapor/issues{/number}","pulls_url":"https://api.github.com/repos/vapor/vapor/pulls{/number}","milestones_url":"https://api.github.com/repos/vapor/vapor/milestones{/number}","notifications_url":"https://api.github.com/repos/vapor/vapor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vapor/vapor/labels{/name}","releases_url":"https://api.github.com/repos/vapor/vapor/releases{/id}","deployments_url":"https://api.github.com/repos/vapor/vapor/deployments","created_at":"2016-01-18T22:37:52Z","updated_at":"2016-11-10T16:10:02Z","pushed_at":"2016-11-10T02:41:03Z","git_url":"git://github.com/vapor/vapor.git","ssh_url":"git@github.com:vapor/vapor.git","clone_url":"https://github.com/vapor/vapor.git","svn_url":"https://github.com/vapor/vapor","homepage":"https://vapor.codes","size":9008,"stargazers_count":7333,"watchers_count":7333,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":395,"mirror_url":null,"open_issues_count":44,"forks":395,"open_issues":44,"watchers":7333,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vapor/vapor/pulls/696"},"html":{"href":"https://github.com/vapor/vapor/pull/696"},"issue":{"href":"https://api.github.com/repos/vapor/vapor/issues/696"},"comments":{"href":"https://api.github.com/repos/vapor/vapor/issues/696/comments"},"review_comments":{"href":"https://api.github.com/repos/vapor/vapor/pulls/696/comments"},"review_comment":{"href":"https://api.github.com/repos/vapor/vapor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vapor/vapor/pulls/696/commits"},"statuses":{"href":"https://api.github.com/repos/vapor/vapor/statuses/7ee9fa6aeb83e4bd51adb1c5496ebaddab201a2b"}}}}
{"actor":{"display_login":"LoganWright"}}