From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10843 invoked by alias); 1 Jul 2002 20:36:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 10810 invoked by uid 71); 1 Jul 2002 20:36:03 -0000 Resent-Date: 1 Jul 2002 20:36:03 -0000 Resent-Message-ID: <20020701203603.10809.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, java-prs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, daveho@cs.umd.edu Received: (qmail 9608 invoked by uid 61); 1 Jul 2002 20:32:05 -0000 Message-Id: <20020701203205.9607.qmail@sources.redhat.com> Date: Mon, 01 Jul 2002 13:36:00 -0000 From: daveho@cs.umd.edu Reply-To: daveho@cs.umd.edu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libgcj/7180: possible bug in javax.naming.spi.NamingManager.getPlusPath() X-SW-Source: 2002-07/txt/msg00016.txt.bz2 List-Id: >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: