Changeset ce47d4ea for router


Ignore:
Timestamp:
Dec 16, 2016 6:06:38 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
c1baee6
Parents:
14a839e
Message:

Profiles: length check on file names

Location:
router/java/src/net/i2p/router
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/RouterVersion.java

    r14a839e rce47d4ea  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 0;
     21    public final static long BUILD = 1;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/peermanager/ProfilePersistenceHelper.java

    r14a839e rce47d4ea  
    4545    private static final String UNCOMPRESSED_SUFFIX = ".txt";
    4646    private static final String OLD_SUFFIX = ".dat";
     47    private static final int MIN_NAME_LENGTH = PREFIX.length() + 44 + OLD_SUFFIX.length();
    4748    private static final String DIR_PREFIX = "p";
    4849    private static final String B64 = Base64.ALPHABET_I2P;
     
    194195        public boolean accept(File dir, String filename) {
    195196            return (filename.startsWith(PREFIX) &&
     197                    filename.length() >= MIN_NAME_LENGTH &&
    196198                    (filename.endsWith(SUFFIX) || filename.endsWith(OLD_SUFFIX) || filename.endsWith(UNCOMPRESSED_SUFFIX)));
    197199        }
Note: See TracChangeset for help on using the changeset viewer.