1105
Use an alist which checks the uniqueness of hash keys with each entry before inserting the
entry.
Demonstrative Examples
Example 1:
The following code adds data to a list and then attempts to sort the data.
Example Language: Python (Bad)
alist = []
while (foo()): #now assume there is a string data with a key basename
queue.append(basename,data)
queue.sort()
Since basename is not necessarily unique, this may not sort how one would like it to be.
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 744 CERT C Secure Coding Standard (2008) Chapter 11 -
Environment (ENV)
734 2348
MemberOf 878 CERT C++ Secure Coding Section 10 - Environment
(ENV)
868 2378
MemberOf 977 SFP Secondary Cluster: Design 888 2407
MemberOf 1412 Comprehensive Categorization: Poor Coding Practices 1400 2538
Taxonomy Mappings
Mapped Taxonomy Name Node ID Fit Mapped Node Name
CLASP Duplicate key in associative list (alist)
CERT C Secure Coding ENV02-C Beware of multiple environment
variables with the same effective name
References
[REF-18]Secure Software, Inc.. "The CLASP Application Security Process". 2005. < https://
cwe.mitre.org/documents/sources/TheCLASPApplicationSecurityProcess.pdf >.
CWE-463: Deletion of Data Structure Sentinel
Weakness ID : 463
Structure : Simple
Abstraction : Base
Description
The accidental deletion of a data-structure sentinel can cause serious programming logic problems.
Extended Description
Often times data-structure sentinels are used to mark structure of the data structure. A common
example of this is the null character at the end of strings. Another common example is linked lists
which may contain a sentinel to mark the end of the list. It is dangerous to allow this type of control
data to be easily accessible. Therefore, it is important to protect from the deletion or modification
outside of some wrapper interface which provides safety.
Relationships
CWE Version 4.14
CWE-463: Deletion of Data Structure Sentinel
CWE-463: Deletion of Data Structure Sentinel