Duplicate keys in associative lists can lead to non-unique keys being mistaken for an error.
A duplicate key entry -- if the alist is designed properly -- could be used as a constant time replace function. However, duplicate key entries could be inserted by mistake. Because of this ambiguity, duplicate key entries in an association list are not recommended and should not be allowed.
Threat Mapped score: 0.0
Industry: Finiancial
Threat priority: Unclassified
N/A
N/A
Phase | Note |
---|---|
Implementation | N/A |
Intro: The following code adds data to a list and then attempts to sort the data.
Body: Since basename is not necessarily unique, this may not sort how one would like it to be.
alist = [] while (foo()): #now assume there is a string data with a key basename queue.append(basename,data) queue.sort()