Skip to content

Files

Latest commit

 

History

History
11 lines (6 loc) · 388 Bytes

terminateStrncpy.md

File metadata and controls

11 lines (6 loc) · 388 Bytes

Pattern: Possibly improper use of strncpy()

Issue: -

Description

If the source string’s size fits or exceeds the given size, strncpy() does not add a zero at the end of the buffer. This causes bugs later in the code if the code assumes buffer is null-terminated.

Further Reading