{"action":"created","issue":{"url":"https://api.github.com/repos/Pi4J/pi4j/issues/143","labels_url":"https://api.github.com/repos/Pi4J/pi4j/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/Pi4J/pi4j/issues/143/comments","events_url":"https://api.github.com/repos/Pi4J/pi4j/issues/143/events","html_url":"https://github.com/Pi4J/pi4j/issues/143","id":63856748,"number":143,"title":"com_pi4j_wiringpi_Spi.c - Buffer size limit","user":{"login":"Shrill-Girl","id":11621515,"avatar_url":"https://avatars.githubusercontent.com/u/11621515?v=3","gravatar_id":"","url":"https://api.github.com/users/Shrill-Girl","html_url":"https://github.com/Shrill-Girl","followers_url":"https://api.github.com/users/Shrill-Girl/followers","following_url":"https://api.github.com/users/Shrill-Girl/following{/other_user}","gists_url":"https://api.github.com/users/Shrill-Girl/gists{/gist_id}","starred_url":"https://api.github.com/users/Shrill-Girl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shrill-Girl/subscriptions","organizations_url":"https://api.github.com/users/Shrill-Girl/orgs","repos_url":"https://api.github.com/users/Shrill-Girl/repos","events_url":"https://api.github.com/users/Shrill-Girl/events{/privacy}","received_events_url":"https://api.github.com/users/Shrill-Girl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Pi4J/pi4j/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-23T23:24:04Z","updated_at":"2015-09-12T22:36:25Z","closed_at":"2015-09-12T22:29:54Z","body":"The file com_pi4j_wiringpi_Spi.c contains a buffer size limit of 2048 bytes for all data transfers via SPI. This limit is fixed while the buffer size of the SPI driver can be changed. Also, the length parameters of the write functions are never checked against the limit, so a buffer overflow may happen during data copy - and will happen if the length argument exceeds 2048. Also the memory in the java arrays is cleared after calling the native methods.\r\n\r\nI propose\r\na) to dynamically allocate buffers of the right size for the data transfer, or at least pass a user defined size limit during initialization and stay with static buffers\r\nb) to add a flag whether the memory should be cleared or not - or additional methods which do not clear the memory "},"comment":{"url":"https://api.github.com/repos/Pi4J/pi4j/issues/comments/139825495","html_url":"https://github.com/Pi4J/pi4j/issues/143#issuecomment-139825495","issue_url":"https://api.github.com/repos/Pi4J/pi4j/issues/143","id":139825495,"user":{"login":"savageautomate","id":2251458,"avatar_url":"https://avatars.githubusercontent.com/u/2251458?v=3","gravatar_id":"","url":"https://api.github.com/users/savageautomate","html_url":"https://github.com/savageautomate","followers_url":"https://api.github.com/users/savageautomate/followers","following_url":"https://api.github.com/users/savageautomate/following{/other_user}","gists_url":"https://api.github.com/users/savageautomate/gists{/gist_id}","starred_url":"https://api.github.com/users/savageautomate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savageautomate/subscriptions","organizations_url":"https://api.github.com/users/savageautomate/orgs","repos_url":"https://api.github.com/users/savageautomate/repos","events_url":"https://api.github.com/users/savageautomate/events{/privacy}","received_events_url":"https://api.github.com/users/savageautomate/received_events","type":"User","site_admin":false},"created_at":"2015-09-12T22:36:25Z","updated_at":"2015-09-12T22:36:25Z","body":"This fix is now available in the latest downloadable Pi4J-1.1-SNAPSHOT build."}}