ibnemahdi / owasp-esapi-java

Automatically exported from code.google.com/p/owasp-esapi-java
Other
0 stars 0 forks source link

NPE in SafeFile.doDirCheck() on empty file path, needs null check. #270

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a SafeFile instance without path.
2. SafeFile file = new SafeFile("hello.txt")
3. NPE is thrown.

What is the expected output? What do you see instead?
Exptected valid SafeFile instance, got NullpointerException.

What version of the product are you using? On what operating system?
Trunk. Windows.

Does this issue affect only a specified browser or set of browsers?
No.

Please provide any additional information below.
    @Test
    public final void safeFileShouldAcceptEmptyPath() throws ValidationException
    {
        String filename = "hello.txt";
        SafeFile file = new SafeFile(filename);

        assertTrue(filename.equals(file.getName()));
    }    

Original issue reported on code.google.com by m.isak...@gmail.com on 20 Apr 2012 at 9:08