17
References
[REF-961]Object Management Group (OMG). "Automated Source Code Reliability Measure
(ASCRM)". 2016 January. < http://www.omg.org/spec/ASCRM/1.0/ >.
[REF-977]QuantStart. "C++ Virtual Destructors: How to Avoid Memory Leaks". < https://
www.quantstart.com/articles/C-Virtual-Destructors-How-to-Avoid-Memory-Leaks/ >.2023-04-07.
[REF-978]GeeksforGeeks. "Virtual Destructor". < https://www.geeksforgeeks.org/virtual-destructor/
>.
CWE-1046: Creation of Immutable Text Using String Concatenation
Weakness ID : 1046
Structure : Simple
Abstraction : Base
Description
The product creates an immutable text string using string concatenation operations.
Extended Description
When building a string via a looping feature (e.g., a FOR or WHILE loop), the use of += to append
to the existing string will result in the creation of a new object with each iteration. This programming
pattern can be inefficient in comparison with use of text buffer data elements. This issue can make
the product perform more slowly. If the relevant code is reachable by an attacker, then this could be
influenced to create performance problem.
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 1176 Inefficient CPU Computation 1971
Relevant to the view "Software Development" (CWE-699)
Nature Type ID Name Page
MemberOf 1006 Bad Coding Practices 2422
Weakness Ordinalities
Indirect :
Common Consequences
Scope Impact Likelihood
Other Reduce Performance
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.
CWE Version 4.14
CWE-1047: Modules with Circular Dependencies
CWE-1047: Modules with Circular Dependencies