Code Correctness: Erroneous String Compare

Revision as of 12:29, 27 May 2009 by MediaWiki spam cleanup (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page was marked to be reviewed for deletion.

#REDIRECT Failure to follow guideline/specification

Last revision (mm/dd/yy): 05/27/2009


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



The following branch will never be taken.

	  if (args[0] == STRING_CONSTANT) {"miracle");

Related Attacks

Related Vulnerabilities

Related Controls

Related Technical Impacts


Note: A reference to related CWE or CAPEC article should be added when exists. Eg: