1109
The first print statement will print each character separated by a space. However, if a non-integer is
read from stdin by getc, then atoi will not make a conversion and return 0. When foo is printed as a
string, the 0 at character foo[2] will act as a NULL terminator and foo[3] will never be printed.
MemberOf Relationships
This MemberOf relationships table shows additional CWE Catgeories and Views that reference this
weakness as a member. This information is often useful in understanding where a weakness fits
within the context of external information sources.
Nature Type ID Name Page
MemberOf 741 CERT C Secure Coding Standard (2008) Chapter 8 -
Characters and Strings (STR)
734 2344
MemberOf 875 CERT C++ Secure Coding Section 07 - Characters and
Strings (STR)
868 2376
MemberOf 977 SFP Secondary Cluster: Design 888 2407
MemberOf 1407 Comprehensive Categorization: Improper Neutralization 1400 2532
Taxonomy Mappings
Mapped Taxonomy Name Node ID Fit Mapped Node Name
CLASP Addition of data-structure sentinel
CERT C Secure Coding STR03-C Do not inadvertently truncate a nullterminated
byte string
CERT C Secure Coding STR06-C Do not assume that strtok() leaves the
parse string unchanged
References
[REF-18]Secure Software, Inc.. "The CLASP Application Security Process". 2005. < https://
cwe.mitre.org/documents/sources/TheCLASPApplicationSecurityProcess.pdf >.
CWE-466: Return of Pointer Value Outside of Expected Range
Weakness ID : 466
Structure : Simple
Abstraction : Base
Description
A function can return a pointer to memory that is outside of the buffer that the pointer is expected to
reference.
Relationships
The table(s) below shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOr and give insight to
similar items that may exist at higher and lower levels of abstraction. In addition, relationships such
as PeerOf and CanAlsoBe are defined to show similar weaknesses that may want to be explored.
Relevant to the view "Research Concepts" (CWE-1000)
Nature Type ID Name Page
ChildOf 119 Improper Restriction of Operations within the Bounds of a
Memory Buffer