{"action":"created","issue":{"url":"https://api.github.com/repos/sigrokproject/libsigrok/issues/6","repository_url":"https://api.github.com/repos/sigrokproject/libsigrok","labels_url":"https://api.github.com/repos/sigrokproject/libsigrok/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/sigrokproject/libsigrok/issues/6/comments","events_url":"https://api.github.com/repos/sigrokproject/libsigrok/issues/6/events","html_url":"https://github.com/sigrokproject/libsigrok/pull/6","id":291119851,"node_id":"MDExOlB1bGxSZXF1ZXN0MTY0NzgyNDI2","number":6,"title":"Unbreak libsigrok fx2lafw on FreeBSD","user":{"login":"smortex","id":148721,"node_id":"MDQ6VXNlcjE0ODcyMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/148721?v=4","gravatar_id":"","url":"https://api.github.com/users/smortex","html_url":"https://github.com/smortex","followers_url":"https://api.github.com/users/smortex/followers","following_url":"https://api.github.com/users/smortex/following{/other_user}","gists_url":"https://api.github.com/users/smortex/gists{/gist_id}","starred_url":"https://api.github.com/users/smortex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smortex/subscriptions","organizations_url":"https://api.github.com/users/smortex/orgs","repos_url":"https://api.github.com/users/smortex/repos","events_url":"https://api.github.com/users/smortex/events{/privacy}","received_events_url":"https://api.github.com/users/smortex/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-01-24T08:20:18Z","updated_at":"2018-06-06T17:09:22Z","closed_at":"2018-02-21T10:49:17Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/sigrokproject/libsigrok/pulls/6","html_url":"https://github.com/sigrokproject/libsigrok/pull/6","diff_url":"https://github.com/sigrokproject/libsigrok/pull/6.diff","patch_url":"https://github.com/sigrokproject/libsigrok/pull/6.patch"},"body":"These patches where sent to the sigrok-devel@ mailing-list but I got no feedback. Since sending patches over a mailing list is a good way to forget about them, and because pull-requests to this repository seems to be merged, please allow me to submit it again :wink:. Thanks!\r\n\r\n-----------\r\n\r\nAfter updating sigrok and pulseview on FreeBSD, I could not use my fx2lafw device anymore.  After investigating the issue, I found out the culprit: when `usb_get_port_path()` is called while the device is open, the function fails, but since the return value is never tested, the uninitialized memory that was supposed to receive the path is copied and considered valid, and execution continues.                                                                                                   \r\n\r\nAs a consequence, when attempting to compare the device path and uninitialized memory later on, no match is found.\r\n\r\nHere are two commits, the first one ensure the device is closed before calling `usb_get_port_path()` (I could only test with the fx2lafw driver, but some drivers had the wrong order and where changed too).  The second patch test the return value of usb_get_port_path() so that errors are not ignored anymore."},"comment":{"url":"https://api.github.com/repos/sigrokproject/libsigrok/issues/comments/395143843","html_url":"https://github.com/sigrokproject/libsigrok/pull/6#issuecomment-395143843","issue_url":"https://api.github.com/repos/sigrokproject/libsigrok/issues/6","id":395143843,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTE0Mzg0Mw==","user":{"login":"smortex","id":148721,"node_id":"MDQ6VXNlcjE0ODcyMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/148721?v=4","gravatar_id":"","url":"https://api.github.com/users/smortex","html_url":"https://github.com/smortex","followers_url":"https://api.github.com/users/smortex/followers","following_url":"https://api.github.com/users/smortex/following{/other_user}","gists_url":"https://api.github.com/users/smortex/gists{/gist_id}","starred_url":"https://api.github.com/users/smortex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smortex/subscriptions","organizations_url":"https://api.github.com/users/smortex/orgs","repos_url":"https://api.github.com/users/smortex/repos","events_url":"https://api.github.com/users/smortex/events{/privacy}","received_events_url":"https://api.github.com/users/smortex/received_events","type":"User","site_admin":false},"created_at":"2018-06-06T17:09:22Z","updated_at":"2018-06-06T17:09:22Z","author_association":"CONTRIBUTOR","body":"@avg-I regarding the port itself, there was no release of libsigrok and the fix was not added as a local patch, to if you are using one of the concerned devices, it will probably not work out of the box with the FreeBSD packages.\r\n\r\nThe change @hselasky did improves how things work at the OS level, but AFAICR, the fix of this PR is needed in all cases.  Maybe it's worth adding a patch to the ports tree.  @avg-I if you have problems with a driver, can you confirm that this patch fixes the problem?"}}
{"actor":{"display_login":"smortex"}}