commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pasha Arājums (JIRA) <j...@apache.org>
Subject [jira] Created: (NET-236) method SubnetUtils.SubnetInfo.isInRange(addr) returns incorrect result
Date Wed, 29 Oct 2008 15:07:44 GMT
method SubnetUtils.SubnetInfo.isInRange(addr) returns incorrect result
----------------------------------------------------------------------

                 Key: NET-236
                 URL: https://issues.apache.org/jira/browse/NET-236
             Project: Commons Net
          Issue Type: Bug
    Affects Versions: 2.0
            Reporter: Pasha Arājums


current implementation failing to check low limit:
{code}
private boolean isInRange(int address)      { return ((address-low()) <= (high()-low()));
}
{code}

suggested fix:
{code}
private boolean isInRange(int address)      { 
    normal = address-low();
    return (normal>=0 && (normal <= (high()-low())));
}
{code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message