+2002-06-18 Jeff Sturm <jsturm@one-point.com>
+
+ * java/net/natPlainDatagramSocketImpl.cc (receive):
+ Check bounds of argument to FD_SET.
+ (setOption): Throw exception if socket is closed.
+
+ * java/net/natPlainSocketImpl.cc (accept, read):
+ Check bounds of argument to FD_SET.
+ (setOption): Throw exception if socket is closed.
+
2002-06-18 Tom Tromey <tromey@redhat.com>
* gcj/javaprims.h: Updated class declaration list.
// FIXME: implement timeout support for Win32
#ifndef WIN32
// Do timeouts via select since SO_RCVTIMEO is not always available.
- if (timeout > 0)
+ if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE)
{
fd_set rset;
struct timeval tv;
int val;
socklen_t val_len = sizeof (val);
+ if (fnum < 0)
+ throw new java::net::SocketException (JvNewStringUTF ("Socket closed"));
+
if (_Jv_IsInstanceOf (value, &BooleanClass))
{
java::lang::Boolean *boolobj =
// FIXME: implement timeout support for Win32
#ifndef WIN32
// Do timeouts via select since SO_RCVTIMEO is not always available.
- if (timeout > 0)
+ if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE)
{
fd_set rset;
struct timeval tv;
// FIXME: implement timeout support for Win32
#ifndef WIN32
// Do timeouts via select.
- if (timeout > 0)
+ if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE)
{
// Create the file descriptor set.
fd_set read_fds;
// FIXME: implement timeout support for Win32
#ifndef WIN32
// Do timeouts via select.
- if (timeout > 0)
+ if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE)
{
// Create the file descriptor set.
fd_set read_fds;
#if defined(HAVE_SELECT)
if (! num_set)
+ if (! num_set && fnum >= 0 && fnum < FD_SETSIZE)
{
fd_set rd;
FD_ZERO (&rd);
int val;
socklen_t val_len = sizeof (val);
+ if (fnum < 0)
+ throw new java::net::SocketException (JvNewStringUTF ("Socket closed"));
+
if (_Jv_IsInstanceOf (value, &java::lang::Boolean::class$))
{
java::lang::Boolean *boolobj =