{"action":"created","issue":{"url":"https://api.github.com/repos/libarchive/libarchive/issues/686","repository_url":"https://api.github.com/repos/libarchive/libarchive","labels_url":"https://api.github.com/repos/libarchive/libarchive/issues/686/labels{/name}","comments_url":"https://api.github.com/repos/libarchive/libarchive/issues/686/comments","events_url":"https://api.github.com/repos/libarchive/libarchive/issues/686/events","html_url":"https://github.com/libarchive/libarchive/issues/686","id":150060957,"number":686,"title":"Logic bug in file archive_string.c line 722 to 740","user":{"login":"duy-github","id":18445713,"avatar_url":"https://avatars.githubusercontent.com/u/18445713?v=3","gravatar_id":"","url":"https://api.github.com/users/duy-github","html_url":"https://github.com/duy-github","followers_url":"https://api.github.com/users/duy-github/followers","following_url":"https://api.github.com/users/duy-github/following{/other_user}","gists_url":"https://api.github.com/users/duy-github/gists{/gist_id}","starred_url":"https://api.github.com/users/duy-github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duy-github/subscriptions","organizations_url":"https://api.github.com/users/duy-github/orgs","repos_url":"https://api.github.com/users/duy-github/repos","events_url":"https://api.github.com/users/duy-github/events{/privacy}","received_events_url":"https://api.github.com/users/duy-github/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-21T12:33:58Z","updated_at":"2016-04-28T05:48:09Z","closed_at":"2016-04-28T05:48:09Z","body":"Here is my patch for my pro:\r\n\r\n```\r\ndo {\r\n\t\t\tdefchar_used = 0;\r\n\t\t\tif (to_cp == CP_UTF8 || sc == NULL)\r\n\t\t\t\tdp = NULL;\r\n\t\t\telse\r\n\t\t\t\tdp = &defchar_used;\r\n\t\t\tcount = WideCharToMultiByte(to_cp, 0, ws, wslen,\r\n\t\t\t    as->s + as->length, (int)as->buffer_length-1, NULL, dp);\r\n\t\t\tif (count == 0 &&\r\n\t\t\t    GetLastError() == ERROR_INSUFFICIENT_BUFFER) {\r\n\t\t\t\t/* Expand the MBS buffer and retry. */\r\n\t\t\t\tif (NULL == archive_string_ensure(as,\r\n\t\t\t\t\tas->buffer_length + len))\r\n\t\t\t\t\treturn (-1);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (count == 0)\r\n\t\t\t\tret = -1;\r\n\t\t\tbreak;\r\n\t\t} while (TRUE);\r\n```"},"comment":{"url":"https://api.github.com/repos/libarchive/libarchive/issues/comments/215316024","html_url":"https://github.com/libarchive/libarchive/issues/686#issuecomment-215316024","issue_url":"https://api.github.com/repos/libarchive/libarchive/issues/686","id":215316024,"user":{"login":"kientzle","id":1398793,"avatar_url":"https://avatars.githubusercontent.com/u/1398793?v=3","gravatar_id":"","url":"https://api.github.com/users/kientzle","html_url":"https://github.com/kientzle","followers_url":"https://api.github.com/users/kientzle/followers","following_url":"https://api.github.com/users/kientzle/following{/other_user}","gists_url":"https://api.github.com/users/kientzle/gists{/gist_id}","starred_url":"https://api.github.com/users/kientzle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kientzle/subscriptions","organizations_url":"https://api.github.com/users/kientzle/orgs","repos_url":"https://api.github.com/users/kientzle/repos","events_url":"https://api.github.com/users/kientzle/events{/privacy}","received_events_url":"https://api.github.com/users/kientzle/received_events","type":"User","site_admin":false},"created_at":"2016-04-28T05:48:09Z","updated_at":"2016-04-28T05:48:09Z","body":"Thank you.  Please look at commit 9134c3a4 and let me know if this fixes the problem.\r\n"}}