W3C home > Mailing lists > Public > xproc-dev@w3.org > July 2011

NPE in Calabash trunk (using property user.home)

From: Florent Georges <fgeorges@fgeorges.org>
Date: Fri, 8 Jul 2011 14:14:31 +0200
Message-ID: <CADyR_r12-iHGSo12GQNtaF7h8bAScF-V2CD1L95Q-imUc0P8QA@mail.gmail.com>
To: XProc Dev <xproc-dev@w3.org>
  Hi,

  In the current revision of the trunk (#672), URIUtils.java
contains the method homeAsURI() which calls dirAsURI() with the
value of the system property "user.home":

    public static URI homeAsURI() {
        return dirAsURI(System.getProperty("user.home"));
    }

  dirAsURI() calls encode() which in turn dereferences the value
of the property without checking for nullness.  Even though it
could be null in some environments (e.g. a web container).

  I am not sure how the null case could be treated (ignoring it?)
but as for now it just crashes with an NPE.

  Regards,

-- 
Florent Georges
http://fgeorges.org/
Received on Friday, 8 July 2011 12:15:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 8 July 2011 12:15:20 GMT