Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Wiki Markup
Copying data in to a buffer that is not large enough to hold that data results in a buffer overflow. While not limited to Null Terminated Byte Strings (NTBS), this type of error often occurs when manipulating NTBS data. To prevent such errors, limit copies either through truncation (although consult \[[STR03-A|STR03-A. Do not inadvertently truncate a null terminated byte string]] for problems that may cause) or, preferably, ensure that the destination is of sufficient size to hold the character data to be copied and the null-termination character.

Include Page
c:STR31 NCCE strcpyoff-by-1
c:STR31 NCCE strcpyoff-by-1
Include Page
c:STR31 CS strcpyoff-by-1
c:STR31 CS off-by-1

strcpy()

Include Page
c:STR31 CS 1 NCCE strcpy_s
c:STR31 CS 1 NCCE strcpy_s
Include Page
c:STR31 NCCE off-by-1CS strcpy
c:STR31 NCCE off-by-1CS strcpy
Include Page
c:STR31 CS off-by-11 strcpy_s
c:STR31 CS off-by-11 strcpy_s

getenv()

Include Page
c:STR31 NCCE 2 getenv
c:STR31 NCCE 2 getenv

...