commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bugs #9280] Closing a socket nulls impl but getImpl() isn't checked for


From: Michael Koch
Subject: [bugs #9280] Closing a socket nulls impl but getImpl() isn't checked for null
Date: Sat, 17 Jul 2004 03:42:15 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Galeon/1.3.15 (Debian package 1.3.15-2)

This mail is an automated notification from the bugs tracker
 of the project: classpath.

/**************************************************************************/
[bugs #9280] Latest Modifications:

Changes by: 
                Michael Koch <address@hidden>
'Date: 
                Sat 07/17/04 at 07:39 (GMT)

            What     | Removed                   | Added
---------------------------------------------------------------------------
          Resolution | None                      | Fixed
              Status | Open                      | Closed


------------------ Additional Follow-up Comments ----------------------------
Fixed by the following patch:

2004-07-17  Michael Koch  <address@hidden>

        * java/net/DatagramSocket.java
        (getLocalAddress): Check if socket is bound or not.
        * java/net/Socket.java
        (getLocalAddrss): Check if socket is bound or not.
        (getPort): Return -1 when not connected. Dont check getImpl() for
        null.
        (setReuseAddress): Check if socket is closed.
        (isConnected): Check if getImpl() returns null.






/**************************************************************************/
[bugs #9280] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=9280>
Project: classpath
Submitted by: David Holmes
On: Thu 06/10/04 at 00:34

Category:  None
Severity:  5 - Average
Resolution:  Fixed
Assigned to:  None
Status:  Closed
Platform Version:  None


Summary:  Closing a socket nulls impl but getImpl() isn't checked for null

Original Submission:  java.net.Socket:

When a socket is closed impl is set to null. However, some methods use 
getImpl() without checking for isClosed() first. In particular:

- isConnected() will throw NullPointerException if called on a closed socket. 
Hence so will
   - getPort
   - getInetAddress
   - getRemoteSocketAddress
   - toString

- getLocalAddress() will throw NullPointerException if called on a closed 
socket.

- setReuseAddress() will throw NullPointerException if called on a closed 
socket.

Follow-up Comments
------------------


-------------------------------------------------------
Date: Sat 07/17/04 at 07:39         By: mkoch
Fixed by the following patch:

2004-07-17  Michael Koch  <address@hidden>

        * java/net/DatagramSocket.java
        (getLocalAddress): Check if socket is bound or not.
        * java/net/Socket.java
        (getLocalAddrss): Check if socket is bound or not.
        (getPort): Return -1 when not connected. Dont check getImpl() for
        null.
        (setReuseAddress): Check if socket is closed.
        (isConnected): Check if getImpl() returns null.












For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=9280>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]