[jcifs] jcifs bug -- null ptr if jcifs.properties missing

Jose Luis Martinez Avial jlmartinez at pb-santander.com
Fri May 30 21:17:19 GMT 2008


I think it was fixed two days ago:

 

-----Original Message-----
From: jcifs-bounces+jlmartinez=bpi-gruposantander.com at lists.samba.org
[mailto:jcifs-bounces+jlmartinez=bpi-gruposantander.com at lists.samba.org]
On Behalf Of Michael B Allen
Sent: Wednesday, May 28, 2008 22:56 PM
To: jcifs at lists.samba.org
Cc: dion gillard
Subject: [jcifs] jcifs-1.2.21 released / DFS Cache Bugfix (1.2.20 was
busted)

Whoops. That was embarrasing.

I have added the necessary fix, uploaded 1.2.21 and tweaked the website
release note.

Thanks Dion,
Mike

On Wed, May 28, 2008 at 8:17 PM, dion gillard <dion at trongus.com> wrote:
> Michael B Allen <ioplex <at> gmail.com> writes:
>
>>
>> The DFS cache was not properly synchronized. This has been fixed. The

>> trusted domains are now looked up with <1C> NetBIOS lookups to speed 
>> discovery.
>>
>> Thanks to Ronny S. for reporting these issues.
>>
>> Mike
>>
>
> Hi Mike,
>
> 1.2.20 introduced a bug in jcifs.Config on line 71.
>
> Please note the following static initializer in that class:
>
> "static {
>        String filename;
>        int level;
>        FileInputStream in = null;
>
>        log = LogStream.getInstance();
>
>        try {
>            filename = System.getProperty( "jcifs.properties" );
>            if( filename != null && filename.length() > 1 ) {
>                in = new FileInputStream( filename );
>            }
>            Config.load( in );
>            in.close();
>        } catch( IOException ioe ) {
>            if( log.level > 0 )
>                ioe.printStackTrace( log );
>        }
> ..."
>
> Note in the try block that the input stream (variable "in") is 
> possibly null when the "in.close()" call is null.
>
> This has caused an NPE when using 1.2.20. 1.2.19 is fine and we've 
> rolled back to that version.
>
> Please let me know if/where I should file a bug report.
>
> Thanks
> dIon
>
>
>
>
>



--
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/





 

-----Original Message-----
From: jcifs-bounces+jlmartinez=bpi-gruposantander.com at lists.samba.org
[mailto:jcifs-bounces+jlmartinez=bpi-gruposantander.com at lists.samba.org]
On Behalf Of Mark Barton
Sent: Friday, May 30, 2008 17:09 PM
To: jcifs at lists.samba.org
Subject: [jcifs] jcifs bug -- null ptr if jcifs.properties missing


I think that I encountered a bug in jcifs/Config.java, version 1.2.20
and I don't know where else to report it.  My apologies if this is the
wrong forum.

In jcifs/Config.java, if the jcifs.properties file doesn't exist, then
"in"
remains null, and a null pointer error is thrown below when in.close()
is attempted, or perhaps the line before that.  As a jCIFS newbie trying
out a simple Hello World program using a simple web.xml file for SSO
authentication, this had me stuck for a while.  The code snippet is
below. 
The suggested fix is to test if in==null before executing these two
lines: 
Config.load( in );
in.close();

Thanks,
Mark Barton

Here's the existing jcfis/Config.java, starting at line 61:

FileInputStream in = null;
log = LogStream.getInstance();

try {
    filename = System.getProperty( "jcifs.properties" );
    if( filename != null && filename.length() > 1 ) {
        in = new FileInputStream( filename );
    }
    Config.load( in );
    in.close();
} catch( IOException ioe ) {
   if( log.level > 0 )
        ioe.printStackTrace( log );
}

 


--
View this message in context:
http://www.nabble.com/jcifs-bug----null-ptr-if-jcifs.properties-missing-
tp17567993p17567993.html
Sent from the Samba - jcifs mailing list archive at Nabble.com.



Internet communications are not secure and therefore Banco 
Santander International does not accept legal responsibility for 
the contents of this message. Any views or opinions presented are 
solely those of the author and do not necessarily represent those 
of Banco Santander International unless otherwise specifically 
stated. 

Las comunicaciones via Internet no son seguras y por lo tanto 
Banco Santander International no asume responsabilidad legal ni 
de ningun otro tipo por el contenido de este mensaje. Cualquier 
opinion transmitida pertenece unicamente al autor y no 
necesariamente representa la opinion del Banco Santander 
International a no ser que este expresamente detallado.




More information about the jcifs mailing list