{"action":"created","issue":{"url":"https://api.github.com/repos/texane/stlink/issues/728","repository_url":"https://api.github.com/repos/texane/stlink","labels_url":"https://api.github.com/repos/texane/stlink/issues/728/labels{/name}","comments_url":"https://api.github.com/repos/texane/stlink/issues/728/comments","events_url":"https://api.github.com/repos/texane/stlink/issues/728/events","html_url":"https://github.com/texane/stlink/pull/728","id":345040308,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0Mjk0MDMy","number":728,"title":"Further fix for read at EOF, don't write if length is zero.","user":{"login":"donmr","id":8844243,"node_id":"MDQ6VXNlcjg4NDQyNDM=","avatar_url":"https://avatars3.githubusercontent.com/u/8844243?v=4","gravatar_id":"","url":"https://api.github.com/users/donmr","html_url":"https://github.com/donmr","followers_url":"https://api.github.com/users/donmr/followers","following_url":"https://api.github.com/users/donmr/following{/other_user}","gists_url":"https://api.github.com/users/donmr/gists{/gist_id}","starred_url":"https://api.github.com/users/donmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donmr/subscriptions","organizations_url":"https://api.github.com/users/donmr/orgs","repos_url":"https://api.github.com/users/donmr/repos","events_url":"https://api.github.com/users/donmr/events{/privacy}","received_events_url":"https://api.github.com/users/donmr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-26T23:33:00Z","updated_at":"2018-07-27T14:18:01Z","closed_at":"2018-07-27T14:18:01Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/texane/stlink/pulls/728","html_url":"https://github.com/texane/stlink/pull/728","diff_url":"https://github.com/texane/stlink/pull/728.diff","patch_url":"https://github.com/texane/stlink/pull/728.patch"},"body":"I found a further problem when reading at the end of a file.\r\n\r\nIf there is some data in the file, but not enough, then after the first read call returns some data, fread will ask for the rest with an updated pointer.  If the first read returned an odd modulo 4 number of bytes, then this second read call will happen with a pointer that is not 32 bit aligned.\r\n\r\nIn do_semihosting, the second read gets 0 bytes but still calls mem_write.  The code in mem_write which forces an aligned address then writes more data than it should altering the values returned from the first read call.\r\n\r\nThis change simply has mem_write return without doing anything if the length is zero."},"comment":{"url":"https://api.github.com/repos/texane/stlink/issues/comments/408432311","html_url":"https://github.com/texane/stlink/pull/728#issuecomment-408432311","issue_url":"https://api.github.com/repos/texane/stlink/issues/728","id":408432311,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODQzMjMxMQ==","user":{"login":"donmr","id":8844243,"node_id":"MDQ6VXNlcjg4NDQyNDM=","avatar_url":"https://avatars3.githubusercontent.com/u/8844243?v=4","gravatar_id":"","url":"https://api.github.com/users/donmr","html_url":"https://github.com/donmr","followers_url":"https://api.github.com/users/donmr/followers","following_url":"https://api.github.com/users/donmr/following{/other_user}","gists_url":"https://api.github.com/users/donmr/gists{/gist_id}","starred_url":"https://api.github.com/users/donmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donmr/subscriptions","organizations_url":"https://api.github.com/users/donmr/orgs","repos_url":"https://api.github.com/users/donmr/repos","events_url":"https://api.github.com/users/donmr/events{/privacy}","received_events_url":"https://api.github.com/users/donmr/received_events","type":"User","site_admin":false},"created_at":"2018-07-27T14:18:00Z","updated_at":"2018-07-27T14:18:00Z","author_association":"CONTRIBUTOR","body":"I'm going to close this PR, and revert the change so I can get the fixes based on the previous review in by themselves.  Then I'll re-submit this one."}}
{"actor":{"display_login":"donmr"}}