Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] File.toPath() usages may result in InvalidPathException

On 24.10.17, 16:09, "jgit-dev-bounces@xxxxxxxxxxx on behalf of Marc Strapetz" <jgit-dev-bounces@xxxxxxxxxxx on behalf of marc.strapetz@xxxxxxxxxxx> wrote:

    I just wanted to point out that jgit has several unsafe usages of 
    File.toPath() which may (and actually do) throw nasty 
    InvalidPathExceptions. The vast majority of bug reports are caused by 
    FileUtils.lastModified and are looking like:
    	at sun.nio.fs.UnixPath.encode(
    	at sun.nio.fs.UnixPath.<init>(
    	at sun.nio.fs.UnixFileSystem.getPath(
    	at org.eclipse.jgit.util.FileUtils.lastModified(
    	at org.eclipse.jgit.util.FS.lastModified(
    I think it would be reasonable to catch the InvalidPathException and 
    convert into an IOException. I can provide a patch, if of interest.

+1, yes, please provide a patch

For 5.0 (planned for June 2018) we may consider migrating from File to Path

Thanks for the heads up 


Back to the top