Reviewing merge request #6: Fix potential string buffer overflow.

Commit fc391f802 introduced a bug in this function, as the strncpy() doesn't put a terminating NULL if the copied string is longer then the provided buffer length. Allocating the buffer as 1 byte longer will ensure that there is a NULL at the end (calloc() fills the buffer with NULLs).

Commits that would be merged:

Version 1
  • Version 1
  • a2e6970
  • a4f3a3b
  • strncpy() doesn't put a terminating NULL if len > n

Showing a2e6970-a4f3a3b

Comments

→ State changed from Open to Closed

Merged. Great find ;).

Add a new comment:

Login or create an account to post a comment

How to apply this merge request to your repository