OpenAMP / open-amp

The main OpenAMP library implementing RPMSG, Virtio, and Remoteproc for RTOS etc
https://www.openampproject.org/
Other
678 stars 278 forks source link

Avoid unsafe strncpy() edge cases by always 0-terminating destination #577

Closed tarmasr closed 3 months ago

tarmasr commented 3 months ago

@arnopo: as requested.

This PR adds 0-termination of the destination buffer after each call of strncpy() in the open-amp project. In one place optional {...} braces were added to an else branch because its if branch now needs braces.