Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: someone pointed out that the description of the 1st NCCE can read as "both strncpy() and strncat() do not guarantee null-termination." I added "in case of strncpy()".

...

Wiki Markup
The {{strcpy_s()}} function defined in \[[ISO/IEC TR 24731-1:2007|AA. Bibliography#ISO/IEC TR 24731-1-2007]\] provides additional safeguards, including accepting the size of the destination buffer as an additional argument. (See recommendation [STR07-C. Use TR 24731C11 Annex K  bounds-checking interfaces for remediation of existing string manipulation code].) Also {{strnlen_s()}} accepts a maximum-length argument for strings that may not be null-terminated.

...