AttackFlow Findings Dictionary

Finding A Way To Try AttackFlow Enterprise Edition?

If so, click to download 15 days full version for free!

Incorrect Call to Equals with Array

The Equals method almost always returns false

Severity

Low

Fix Cost

Low

Trust Level

Medium

Equals method is used to determine whether the specified object is equal to the current object. When it is used on arrays, which are objects, the reference equality is checked instead of content equality.

            
                int [] a = { 1, 2, 3 ,4, 5, 6 };
int [] b = { 1, 2, 3 ,4, 5, 6 };
if(a.Equals(b)) // always calculated to false 
{
  ...
}
                 
            

This is more obvious, but the same fallacy occurs with the == operator such as;

            
int [] a = { 1, 2, 3 ,4, 5, 6 };
int [] b = { 1, 2, 3 ,4, 5, 6 };
if(a == b) // always calculated to false 
{
...
}
          
            

Finding A Way To Purchase AttackFlow Enterprise Edition?

If so, click to buy now for yearly subscriptions!