public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libgcj/7180: possible bug in javax.naming.spi.NamingManager.getPlusPath()
@ 2002-07-01 13:36 daveho
  0 siblings, 0 replies; 3+ messages in thread
From: daveho @ 2002-07-01 13:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7180
>Category:       libgcj
>Synopsis:       possible bug in javax.naming.spi.NamingManager.getPlusPath()
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 01 13:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     daveho@cs.umd.edu
>Release:        libjava from CVS, dated June 27, 2002
>Organization:
>Environment:
Jikes RVM, RedHat Linux 7.2
>Description:
The javax.naming.spi.NamingManager.getPlusPath() method will instantiate a StringTokenizer() on a null string if a path element is found in neither the passed-in environment nor the passed-in Context, which will then cause a NullPointerException.  However, for the getStateToBind() method (also in NamingManager), it should be legal for the path to be empty.  I've attached a small patch which should fix the problem.

Note that I'm not using gcj.  However, this problem should be easy to reproduce on any VM.
>How-To-Repeat:
Any call to javax.naming.spi.NamingManager.getStateToBind() where neither the environment nor the Context contains a value associated with Context.STATE_FACTORIES.
>Fix:
diff -u -r1.1 NamingManager.java
--- NamingManager.java	2002/06/27 21:00:14	1.1
+++ NamingManager.java	2002/07/01 20:10:14
@@ -170,7 +170,7 @@
       path = path2;
     else if (path2 != null)
       path += ":" + path2;
-    return new StringTokenizer (path, ":");
+    return new StringTokenizer (path != null ? path : "", ":");
   }
 
   public static Object getObjectInstance (Object refInfo,
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libgcj/7180: possible bug in javax.naming.spi.NamingManager.getPlusPath()
@ 2002-07-01 19:47 tromey
  0 siblings, 0 replies; 3+ messages in thread
From: tromey @ 2002-07-01 19:47 UTC (permalink / raw)
  To: daveho, gcc-bugs, gcc-prs, java-prs, nobody, tromey

Synopsis: possible bug in javax.naming.spi.NamingManager.getPlusPath()

Responsible-Changed-From-To: unassigned->tromey
Responsible-Changed-By: tromey
Responsible-Changed-When: Mon Jul  1 19:47:17 2002
Responsible-Changed-Why:
    I'm handling this.
State-Changed-From-To: open->closed
State-Changed-By: tromey
State-Changed-When: Mon Jul  1 19:47:17 2002
State-Changed-Why:
    I checked in the patch.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7180


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libgcj/7180: possible bug in javax.naming.spi.NamingManager.getPlusPath()
@ 2002-07-01 19:46 Tom Tromey
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2002-07-01 19:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR libgcj/7180; it has been noted by GNATS.

From: Tom Tromey <tromey@redhat.com>
To: daveho@cs.umd.edu
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libgcj/7180: possible bug in javax.naming.spi.NamingManager.getPlusPath()
Date: 01 Jul 2002 20:54:10 -0600

 >>>>> "daveho" == daveho  <daveho@cs.umd.edu> writes:
 
 daveho> The javax.naming.spi.NamingManager.getPlusPath() method will
 daveho> instantiate a StringTokenizer() on a null string if a path
 daveho> element is found in neither the passed-in environment nor the
 daveho> passed-in Context, which will then cause a
 daveho> NullPointerException.
 
 Thanks, I'm checking in your patch.
 
 daveho> Note that I'm not using gcj.
 
 I assume you are using some or all of the libgcj classes with Jikes
 RVM?  Ever thought about integrating the RVM JIT into libgcj?
 (Assuming, of course, that the licenses are compatible.)
 
 Tom


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-07-02  2:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-01 13:36 libgcj/7180: possible bug in javax.naming.spi.NamingManager.getPlusPath() daveho
2002-07-01 19:46 Tom Tromey
2002-07-01 19:47 tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).