You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/10/13 14:05:51 UTC

[GitHub] [incubator-nuttx] fjpanag opened a new pull request, #7305: Fixed NULL pointer use in tmpfs.

fjpanag opened a new pull request, #7305:
URL: https://github.com/apache/incubator-nuttx/pull/7305

   ## Summary
   
   When the file size is 0 and the data to be written is also 0 (in case of `tmpfs_write()`) then `tfo->tfo_data` will be NULL.
   
   Previously, the code used this buffer unconditionally with `memcpy()` (albeit with 0 size), which is wrong.  
   The `memcpy()` arguments must always be non-NULL, regardless of the size.
   
   An UBSan warning was also triggered for this.
   
   This PR fixes this, ensuring that only non-NULL arguments are provided to memcpy.
   
   ## Impact
   
   UB fix.
   
   ## Testing
   
   Tested by writing 0 bytes to an empty tmpfs file.  
   No issues, no UBSan warnings.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on pull request #7305: Fixed NULL pointer use in tmpfs.

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on PR #7305:
URL: https://github.com/apache/incubator-nuttx/pull/7305#issuecomment-1278499165

   Please rebase


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #7305: Fixed NULL pointer use in tmpfs.

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #7305:
URL: https://github.com/apache/incubator-nuttx/pull/7305


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org