Check for NULL outbuf in silc_socket_write.
authorPekka Riikonen <priikone@silcnet.org>
Wed, 11 Dec 2002 19:05:35 +0000 (19:05 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 11 Dec 2002 19:05:35 +0000 (19:05 +0000)
CHANGES
lib/silcutil/unix/silcunixsockconn.c
lib/silcutil/win32/silcwin32sockconn.c

diff --git a/CHANGES b/CHANGES
index 5c44161c44952a9c363f3dab18c65e647b39f2eb..348d20096fdc6b478a5837b5a97ee64551748f99 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,10 @@ Wed Dec 11 20:20:07 EET 2002 Pekka Riikonen <priikone@silcnet.org>
        * Fixed close command to use the port correctly when closing
          server connections.  Affected file silcd/idlist.c.
 
+       * Check for NULL outbuf in silc_socket_write.  It is possible
+         that it is NULL is some odd case.  Affected files are
+         lib/silcutil/[unix/win32]/silc[unix/win32]sockconn.c.
+
 Wed Dec 11 10:01:26 CET 2002 Pekka Riikonen <priikone@silcnet.org>
 
        * Fixed double free in SKE library error hadling when signature
index 285d9418fe84fdd77e5bd5c7f8e39b0b1fc01803..4d14ac5fc323626aa037aeff5eabedeca60441da 100644 (file)
@@ -33,6 +33,8 @@ int silc_socket_write(SilcSocketConnection sock)
   int fd = sock->sock;
   SilcBuffer src = sock->outbuf;
 
+  if (!src)
+    return -2;
   if (SILC_IS_DISABLED(sock))
     return -1;
 
index 52515bbe82455d7869988cc2039ed0f989754e8f..55f37e56fa6307f6feab57c5471fb9ed4d3a35e8 100644 (file)
@@ -33,6 +33,8 @@ int silc_socket_write(SilcSocketConnection sock)
   SOCKET fd = sock->sock;
   SilcBuffer src = sock->outbuf;
 
+  if (!src)
+    return -2;
   if (SILC_IS_DISABLED(sock))
     return -1;