{"action":"created","comment":{"url":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/comments/31670027","id":31670027,"diff_hunk":"@@ -634,27 +634,29 @@ HRESULT PathCchStripToRootW(PWSTR pszPath, size_t cchPath)\n HRESULT PathCchStripPrefixA(PSTR pszPath, size_t cchPath)\n {\n \tBOOL hasPrefix;\n-\tBOOL deviceNamespace;\n \n \tif (!pszPath)\n-\t\treturn S_FALSE;\n+\t\treturn E_INVALIDARG;\n \n-\tif (cchPath < 4)\n-\t\treturn S_FALSE;\n+\tif (cchPath < 4 || cchPath > PATHCCH_MAX_CCH)\n+\t\treturn E_INVALIDARG;\n \n \thasPrefix = ((pszPath[0] == '\\\\') && (pszPath[1] == '\\\\') &&\n \t\t(pszPath[2] == '?') && (pszPath[3] == '\\\\')) ? TRUE : FALSE;\n \n \tif (hasPrefix)\n \t{\n-\t\tif (cchPath < 7)\n+\t\tif (cchPath < 6)\n \t\t\treturn S_FALSE;","path":"winpr/libwinpr/path/path.c","position":22,"original_position":22,"commit_id":"178afd8dd5c1f00b3bbfd97f960f603233f5851d","original_commit_id":"178afd8dd5c1f00b3bbfd97f960f603233f5851d","user":{"login":"nfedera","id":670606,"avatar_url":"https://avatars.githubusercontent.com/u/670606?v=3","gravatar_id":"","url":"https://api.github.com/users/nfedera","html_url":"https://github.com/nfedera","followers_url":"https://api.github.com/users/nfedera/followers","following_url":"https://api.github.com/users/nfedera/following{/other_user}","gists_url":"https://api.github.com/users/nfedera/gists{/gist_id}","starred_url":"https://api.github.com/users/nfedera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfedera/subscriptions","organizations_url":"https://api.github.com/users/nfedera/orgs","repos_url":"https://api.github.com/users/nfedera/repos","events_url":"https://api.github.com/users/nfedera/events{/privacy}","received_events_url":"https://api.github.com/users/nfedera/received_events","type":"User","site_admin":false},"body":"Update: it has the prefix but nothing where the prefix can be removed from. So that's perfectly fine ","created_at":"2015-06-03T21:06:26Z","updated_at":"2015-06-03T21:06:26Z","html_url":"https://github.com/FreeRDP/FreeRDP/pull/2676#discussion_r31670027","pull_request_url":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/2676","_links":{"self":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/comments/31670027"},"html":{"href":"https://github.com/FreeRDP/FreeRDP/pull/2676#discussion_r31670027"},"pull_request":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/2676"}}},"pull_request":{"url":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/2676","id":36837105,"html_url":"https://github.com/FreeRDP/FreeRDP/pull/2676","diff_url":"https://github.com/FreeRDP/FreeRDP/pull/2676.diff","patch_url":"https://github.com/FreeRDP/FreeRDP/pull/2676.patch","issue_url":"https://api.github.com/repos/FreeRDP/FreeRDP/issues/2676","number":2676,"state":"open","locked":false,"title":"winpr: fixed some misuses of S_FALSE","user":{"login":"nfedera","id":670606,"avatar_url":"https://avatars.githubusercontent.com/u/670606?v=3","gravatar_id":"","url":"https://api.github.com/users/nfedera","html_url":"https://github.com/nfedera","followers_url":"https://api.github.com/users/nfedera/followers","following_url":"https://api.github.com/users/nfedera/following{/other_user}","gists_url":"https://api.github.com/users/nfedera/gists{/gist_id}","starred_url":"https://api.github.com/users/nfedera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfedera/subscriptions","organizations_url":"https://api.github.com/users/nfedera/orgs","repos_url":"https://api.github.com/users/nfedera/repos","events_url":"https://api.github.com/users/nfedera/events{/privacy}","received_events_url":"https://api.github.com/users/nfedera/received_events","type":"User","site_admin":false},"body":"Contrary to popular belief S_FALSE is a HRESULT success code and is not used to indicate an error. That is why they prefix with an S_ ;)\r\n\r\nPathCchAppend:\r\n- Make this function behave like the Windows 8 implementation and the according MSDN specification.\r\n- return E_INVALIDARG instead of S_FALSE if pszPath is NULL\r\n- return E_INVALIDARG instead of S_FALSE if pszMore is NULL\r\n- return E_INVALIDARG if cchPath is zero\r\n- return E_INVALIDARG if cchPath is greater than PATHCCH_MAX_CCH\r\n- return HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE) if the combined  path size exceeds cchPath (this is the same HRESULT which the Windows  implementation returns in this case and which is referred to as  PATHCCH_E_FILENAME_TOO_LONG on msdn)\r\n- extended/fixed the TestPathCchAppend ctest\r\n\r\nPathCchStripPrefix:\r\n- fixed to be compatible to the Windows 8 implementation of this function:\r\n- return E_INVALIDARG instead of S_FALSE if pszPath is NULL\r\n- return E_INVALIDARG instead of S_FALSE if cchPath < 4\r\n- return E_INVALIDARG if cchPath > PATHCCH_MAX_CCH\r\n- allow stripping of \"\\\\?\\c:\" and don't require \"\\\\?\\c:\\\"\r\n- verify that the character at the drive letter position is actually an alphabetic character\r\n- since the passed pszPath must not necessarily be null terminated and we always have enough  space after the memmove we can always ensure the null termination of the stripped result\r\n- extended/fixed the TestPathCchStripPrefixctest\r\n\r\nPathCchAddExtension:\r\n- return E_INVALIDARG instead of S_FALSE\r\n- return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) instead of S_FALSE\r\n- extended/fixed the corresponding ctest\r\n\r\nPathCchAddBackslashEx\r\n- return E_INVALIDARG instead of S_FALSE\r\n- return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) instead of S_FALSE\r\n- extended/fixed the corresponding ctest\r\n\r\nPathCchAddBackslash\r\n- return E_INVALIDARG instead of S_FALSE\r\n- return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) instead of S_FALSE\r\n- extended/fixed the corresponding ctest\r\n\r\n\r\nMore PathCch fixes next week in a separate PR\r\n","created_at":"2015-06-03T14:18:35Z","updated_at":"2015-06-03T21:06:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0df4940bf9fab282e431114cc599d9ba5b910e8a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/2676/commits","review_comments_url":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/2676/comments","review_comment_url":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FreeRDP/FreeRDP/issues/2676/comments","statuses_url":"https://api.github.com/repos/FreeRDP/FreeRDP/statuses/178afd8dd5c1f00b3bbfd97f960f603233f5851d","head":{"label":"nfedera:fix-hresult-xxx","ref":"fix-hresult-xxx","sha":"178afd8dd5c1f00b3bbfd97f960f603233f5851d","user":{"login":"nfedera","id":670606,"avatar_url":"https://avatars.githubusercontent.com/u/670606?v=3","gravatar_id":"","url":"https://api.github.com/users/nfedera","html_url":"https://github.com/nfedera","followers_url":"https://api.github.com/users/nfedera/followers","following_url":"https://api.github.com/users/nfedera/following{/other_user}","gists_url":"https://api.github.com/users/nfedera/gists{/gist_id}","starred_url":"https://api.github.com/users/nfedera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfedera/subscriptions","organizations_url":"https://api.github.com/users/nfedera/orgs","repos_url":"https://api.github.com/users/nfedera/repos","events_url":"https://api.github.com/users/nfedera/events{/privacy}","received_events_url":"https://api.github.com/users/nfedera/received_events","type":"User","site_admin":false},"repo":{"id":2591242,"name":"FreeRDP","full_name":"nfedera/FreeRDP","owner":{"login":"nfedera","id":670606,"avatar_url":"https://avatars.githubusercontent.com/u/670606?v=3","gravatar_id":"","url":"https://api.github.com/users/nfedera","html_url":"https://github.com/nfedera","followers_url":"https://api.github.com/users/nfedera/followers","following_url":"https://api.github.com/users/nfedera/following{/other_user}","gists_url":"https://api.github.com/users/nfedera/gists{/gist_id}","starred_url":"https://api.github.com/users/nfedera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfedera/subscriptions","organizations_url":"https://api.github.com/users/nfedera/orgs","repos_url":"https://api.github.com/users/nfedera/repos","events_url":"https://api.github.com/users/nfedera/events{/privacy}","received_events_url":"https://api.github.com/users/nfedera/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nfedera/FreeRDP","description":"FreeRDP is a free remote desktop protocol client","fork":true,"url":"https://api.github.com/repos/nfedera/FreeRDP","forks_url":"https://api.github.com/repos/nfedera/FreeRDP/forks","keys_url":"https://api.github.com/repos/nfedera/FreeRDP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nfedera/FreeRDP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nfedera/FreeRDP/teams","hooks_url":"https://api.github.com/repos/nfedera/FreeRDP/hooks","issue_events_url":"https://api.github.com/repos/nfedera/FreeRDP/issues/events{/number}","events_url":"https://api.github.com/repos/nfedera/FreeRDP/events","assignees_url":"https://api.github.com/repos/nfedera/FreeRDP/assignees{/user}","branches_url":"https://api.github.com/repos/nfedera/FreeRDP/branches{/branch}","tags_url":"https://api.github.com/repos/nfedera/FreeRDP/tags","blobs_url":"https://api.github.com/repos/nfedera/FreeRDP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nfedera/FreeRDP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nfedera/FreeRDP/git/refs{/sha}","trees_url":"https://api.github.com/repos/nfedera/FreeRDP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nfedera/FreeRDP/statuses/{sha}","languages_url":"https://api.github.com/repos/nfedera/FreeRDP/languages","stargazers_url":"https://api.github.com/repos/nfedera/FreeRDP/stargazers","contributors_url":"https://api.github.com/repos/nfedera/FreeRDP/contributors","subscribers_url":"https://api.github.com/repos/nfedera/FreeRDP/subscribers","subscription_url":"https://api.github.com/repos/nfedera/FreeRDP/subscription","commits_url":"https://api.github.com/repos/nfedera/FreeRDP/commits{/sha}","git_commits_url":"https://api.github.com/repos/nfedera/FreeRDP/git/commits{/sha}","comments_url":"https://api.github.com/repos/nfedera/FreeRDP/comments{/number}","issue_comment_url":"https://api.github.com/repos/nfedera/FreeRDP/issues/comments{/number}","contents_url":"https://api.github.com/repos/nfedera/FreeRDP/contents/{+path}","compare_url":"https://api.github.com/repos/nfedera/FreeRDP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nfedera/FreeRDP/merges","archive_url":"https://api.github.com/repos/nfedera/FreeRDP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nfedera/FreeRDP/downloads","issues_url":"https://api.github.com/repos/nfedera/FreeRDP/issues{/number}","pulls_url":"https://api.github.com/repos/nfedera/FreeRDP/pulls{/number}","milestones_url":"https://api.github.com/repos/nfedera/FreeRDP/milestones{/number}","notifications_url":"https://api.github.com/repos/nfedera/FreeRDP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nfedera/FreeRDP/labels{/name}","releases_url":"https://api.github.com/repos/nfedera/FreeRDP/releases{/id}","created_at":"2011-10-17T11:10:16Z","updated_at":"2015-04-09T15:03:22Z","pushed_at":"2015-06-03T14:06:20Z","git_url":"git://github.com/nfedera/FreeRDP.git","ssh_url":"git@github.com:nfedera/FreeRDP.git","clone_url":"https://github.com/nfedera/FreeRDP.git","svn_url":"https://github.com/nfedera/FreeRDP","homepage":"http://www.freerdp.com/","size":108917,"stargazers_count":2,"watchers_count":2,"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":2,"default_branch":"master"}},"base":{"label":"FreeRDP:master","ref":"master","sha":"6b92fe38059161f08426508fae289b11217a7a04","user":{"login":"FreeRDP","id":663376,"avatar_url":"https://avatars.githubusercontent.com/u/663376?v=3","gravatar_id":"","url":"https://api.github.com/users/FreeRDP","html_url":"https://github.com/FreeRDP","followers_url":"https://api.github.com/users/FreeRDP/followers","following_url":"https://api.github.com/users/FreeRDP/following{/other_user}","gists_url":"https://api.github.com/users/FreeRDP/gists{/gist_id}","starred_url":"https://api.github.com/users/FreeRDP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FreeRDP/subscriptions","organizations_url":"https://api.github.com/users/FreeRDP/orgs","repos_url":"https://api.github.com/users/FreeRDP/repos","events_url":"https://api.github.com/users/FreeRDP/events{/privacy}","received_events_url":"https://api.github.com/users/FreeRDP/received_events","type":"Organization","site_admin":false},"repo":{"id":1979797,"name":"FreeRDP","full_name":"FreeRDP/FreeRDP","owner":{"login":"FreeRDP","id":663376,"avatar_url":"https://avatars.githubusercontent.com/u/663376?v=3","gravatar_id":"","url":"https://api.github.com/users/FreeRDP","html_url":"https://github.com/FreeRDP","followers_url":"https://api.github.com/users/FreeRDP/followers","following_url":"https://api.github.com/users/FreeRDP/following{/other_user}","gists_url":"https://api.github.com/users/FreeRDP/gists{/gist_id}","starred_url":"https://api.github.com/users/FreeRDP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FreeRDP/subscriptions","organizations_url":"https://api.github.com/users/FreeRDP/orgs","repos_url":"https://api.github.com/users/FreeRDP/repos","events_url":"https://api.github.com/users/FreeRDP/events{/privacy}","received_events_url":"https://api.github.com/users/FreeRDP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FreeRDP/FreeRDP","description":"FreeRDP is a free remote desktop protocol client","fork":false,"url":"https://api.github.com/repos/FreeRDP/FreeRDP","forks_url":"https://api.github.com/repos/FreeRDP/FreeRDP/forks","keys_url":"https://api.github.com/repos/FreeRDP/FreeRDP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FreeRDP/FreeRDP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FreeRDP/FreeRDP/teams","hooks_url":"https://api.github.com/repos/FreeRDP/FreeRDP/hooks","issue_events_url":"https://api.github.com/repos/FreeRDP/FreeRDP/issues/events{/number}","events_url":"https://api.github.com/repos/FreeRDP/FreeRDP/events","assignees_url":"https://api.github.com/repos/FreeRDP/FreeRDP/assignees{/user}","branches_url":"https://api.github.com/repos/FreeRDP/FreeRDP/branches{/branch}","tags_url":"https://api.github.com/repos/FreeRDP/FreeRDP/tags","blobs_url":"https://api.github.com/repos/FreeRDP/FreeRDP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FreeRDP/FreeRDP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FreeRDP/FreeRDP/git/refs{/sha}","trees_url":"https://api.github.com/repos/FreeRDP/FreeRDP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FreeRDP/FreeRDP/statuses/{sha}","languages_url":"https://api.github.com/repos/FreeRDP/FreeRDP/languages","stargazers_url":"https://api.github.com/repos/FreeRDP/FreeRDP/stargazers","contributors_url":"https://api.github.com/repos/FreeRDP/FreeRDP/contributors","subscribers_url":"https://api.github.com/repos/FreeRDP/FreeRDP/subscribers","subscription_url":"https://api.github.com/repos/FreeRDP/FreeRDP/subscription","commits_url":"https://api.github.com/repos/FreeRDP/FreeRDP/commits{/sha}","git_commits_url":"https://api.github.com/repos/FreeRDP/FreeRDP/git/commits{/sha}","comments_url":"https://api.github.com/repos/FreeRDP/FreeRDP/comments{/number}","issue_comment_url":"https://api.github.com/repos/FreeRDP/FreeRDP/issues/comments{/number}","contents_url":"https://api.github.com/repos/FreeRDP/FreeRDP/contents/{+path}","compare_url":"https://api.github.com/repos/FreeRDP/FreeRDP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FreeRDP/FreeRDP/merges","archive_url":"https://api.github.com/repos/FreeRDP/FreeRDP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FreeRDP/FreeRDP/downloads","issues_url":"https://api.github.com/repos/FreeRDP/FreeRDP/issues{/number}","pulls_url":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls{/number}","milestones_url":"https://api.github.com/repos/FreeRDP/FreeRDP/milestones{/number}","notifications_url":"https://api.github.com/repos/FreeRDP/FreeRDP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FreeRDP/FreeRDP/labels{/name}","releases_url":"https://api.github.com/repos/FreeRDP/FreeRDP/releases{/id}","created_at":"2011-06-30T19:14:15Z","updated_at":"2015-06-03T20:56:04Z","pushed_at":"2015-06-03T14:18:36Z","git_url":"git://github.com/FreeRDP/FreeRDP.git","ssh_url":"git@github.com:FreeRDP/FreeRDP.git","clone_url":"https://github.com/FreeRDP/FreeRDP.git","svn_url":"https://github.com/FreeRDP/FreeRDP","homepage":"http://www.freerdp.com/","size":122548,"stargazers_count":974,"watchers_count":974,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":630,"mirror_url":null,"open_issues_count":551,"forks":630,"open_issues":551,"watchers":974,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/2676"},"html":{"href":"https://github.com/FreeRDP/FreeRDP/pull/2676"},"issue":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/issues/2676"},"comments":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/issues/2676/comments"},"review_comments":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/2676/comments"},"review_comment":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/2676/commits"},"statuses":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/statuses/178afd8dd5c1f00b3bbfd97f960f603233f5851d"}}}}