Changeset 662fe3e


Ignore:
Timestamp:
Jun 10, 2014 7:54:05 PM (7 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
e692e21d
Parents:
1bf8fd92
Message:
  • i2psnark: Fix decoding of negative numbers (ticket #1307)
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/bencode/BDecoder.java

    r1bf8fd92 r662fe3e  
    2222
    2323import java.io.EOFException;
     24import java.io.FileInputStream;
    2425import java.io.IOException;
    2526import java.io.InputStream;
     
    233234    if (c == '-')
    234235      {
     236        chars.append((char)c);
    235237        c = read();
    236         if (c == '0')
    237           throw new InvalidBEncodingException("Negative zero not allowed");
    238         chars.append((char)c);
    239238      }
    240239
     
    377376  }
    378377
     378  /**
     379   *  prints out the decoded data
     380   *  @since 0.9.14
     381   */
     382  public static void main(String[] args) {
     383    if (args.length != 1) {
     384        System.err.println("Usage: BDecoder file.torrent");
     385        System.exit(1);
     386    }
     387    try {
     388        BEValue bev = bdecode(new FileInputStream(args[0]));
     389        System.out.println(bev.toString());
     390    } catch (IOException ioe) {
     391        ioe.printStackTrace();
     392        System.exit(1);
     393    }
     394  }
    379395}
  • history.txt

    r1bf8fd92 r662fe3e  
     12014-06-10 zzz
     2 * i2psnark: Fix decoding of negative numbers (ticket #1307)
     3 * NewsFetcher: Only treat correct status codes as success
     4
    152014-06-09 zzz
    26 * i2psnark:
  • router/java/src/net/i2p/router/RouterVersion.java

    r1bf8fd92 r662fe3e  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 5;
     21    public final static long BUILD = 6;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.