Changeset 2d24f213


Ignore:
Timestamp:
Jun 26, 2018 6:48:04 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
baa11d8
Parents:
96c565d
Message:

Streaming: Enforce valid port in setters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketOptionsImpl.java

    r96c565d r2d24f213  
    231231     *  The remote port.
    232232     *  @param port 0 - 65535
     233     *  @throws IllegalArgumentException
    233234     *  @since 0.8.9
    234235     */
    235236    public void setPort(int port) {
     237        if (port < 0 || port > 65535)
     238            throw new IllegalArgumentException("bad port");
    236239        _remotePort = port;
    237240    }
     
    252255     *  as most applications do not specify a remote port.
    253256     *  @param port 0 - 65535
     257     *  @throws IllegalArgumentException
    254258     *  @since 0.8.9
    255259     */
    256260    public void setLocalPort(int port) {
     261        if (port < 0 || port > 65535)
     262            throw new IllegalArgumentException("bad port");
    257263        _localPort = port;
    258264    }
Note: See TracChangeset for help on using the changeset viewer.