Difference between revisions of "Code Correctness: Erroneous String Compare"
From OWASP
(→References) |
|||
| Line 58: | Line 58: | ||
* http://www.link1.com | * http://www.link1.com | ||
* [http://www.link2.com Title for the link2] | * [http://www.link2.com Title for the link2] | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Revision as of 11:18, 11 February 2009
This is a Vulnerability. To view all vulnerabilities, please see the Vulnerability Category page.
Contents
Last revision (mm/dd/yy): 02/11/2009
Description
Strings should be compared with the equals() method, not == or !=.
This program uses == or != to compare two strings for equality, which compares two objects for equality, not their values. Chances are good that the two references will never be equal.
Risk Factors
TBD
Examples
The following branch will never be taken.
if (args[0] == STRING_CONSTANT) {
logger.info("miracle");
}
Related Attacks
Related Vulnerabilities
Related Controls
Related Technical Impacts
References
Note: A reference to related CWE or CAPEC article should be added when exists. Eg: