(Ancient, binary compatible fixes found sitting in my tree)
authorRon Steinke <rsteinke@src.gnome.org>
Sun, 5 Jan 2003 18:11:15 +0000 (18:11 +0000)
committerRon Steinke <rsteinke@src.gnome.org>
Sun, 5 Jan 2003 18:11:15 +0000 (18:11 +0000)
* Added early checks for count == 0 and buf == NULL in g_io_channel_read()
* Better error message for EFAULT in  g_io_channel_error_from_errno()

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/giochannel.c

index b4291d2..c43e78b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-01-25  Ron Steinke  <rsteinke@w-link.net>
+
+       (Ancient, binary compatible fixes found sitting in my tree)
+
+       * Added early checks for count == 0 and buf == NULL in g_io_channel_read()
+
+       * Better error message for EFAULT in  g_io_channel_error_from_errno()
+
 2003-01-04  Tor Lillqvist  <tml@iki.fi>
 
        * Makefile.am (BUILT_EXTRA_DIST): Don't distribute glib-zip.
index b4291d2..c43e78b 100644 (file)
@@ -1,3 +1,11 @@
+2003-01-25  Ron Steinke  <rsteinke@w-link.net>
+
+       (Ancient, binary compatible fixes found sitting in my tree)
+
+       * Added early checks for count == 0 and buf == NULL in g_io_channel_read()
+
+       * Better error message for EFAULT in  g_io_channel_error_from_errno()
+
 2003-01-04  Tor Lillqvist  <tml@iki.fi>
 
        * Makefile.am (BUILT_EXTRA_DIST): Don't distribute glib-zip.
index b4291d2..c43e78b 100644 (file)
@@ -1,3 +1,11 @@
+2003-01-25  Ron Steinke  <rsteinke@w-link.net>
+
+       (Ancient, binary compatible fixes found sitting in my tree)
+
+       * Added early checks for count == 0 and buf == NULL in g_io_channel_read()
+
+       * Better error message for EFAULT in  g_io_channel_error_from_errno()
+
 2003-01-04  Tor Lillqvist  <tml@iki.fi>
 
        * Makefile.am (BUILT_EXTRA_DIST): Don't distribute glib-zip.
index b4291d2..c43e78b 100644 (file)
@@ -1,3 +1,11 @@
+2003-01-25  Ron Steinke  <rsteinke@w-link.net>
+
+       (Ancient, binary compatible fixes found sitting in my tree)
+
+       * Added early checks for count == 0 and buf == NULL in g_io_channel_read()
+
+       * Better error message for EFAULT in  g_io_channel_error_from_errno()
+
 2003-01-04  Tor Lillqvist  <tml@iki.fi>
 
        * Makefile.am (BUILT_EXTRA_DIST): Don't distribute glib-zip.
index b4291d2..c43e78b 100644 (file)
@@ -1,3 +1,11 @@
+2003-01-25  Ron Steinke  <rsteinke@w-link.net>
+
+       (Ancient, binary compatible fixes found sitting in my tree)
+
+       * Added early checks for count == 0 and buf == NULL in g_io_channel_read()
+
+       * Better error message for EFAULT in  g_io_channel_error_from_errno()
+
 2003-01-04  Tor Lillqvist  <tml@iki.fi>
 
        * Makefile.am (BUILT_EXTRA_DIST): Don't distribute glib-zip.
index b4291d2..c43e78b 100644 (file)
@@ -1,3 +1,11 @@
+2003-01-25  Ron Steinke  <rsteinke@w-link.net>
+
+       (Ancient, binary compatible fixes found sitting in my tree)
+
+       * Added early checks for count == 0 and buf == NULL in g_io_channel_read()
+
+       * Better error message for EFAULT in  g_io_channel_error_from_errno()
+
 2003-01-04  Tor Lillqvist  <tml@iki.fi>
 
        * Makefile.am (BUILT_EXTRA_DIST): Don't distribute glib-zip.
index 68ed280..2c75a6d 100644 (file)
@@ -180,6 +180,15 @@ g_io_channel_read (GIOChannel *channel,
   g_return_val_if_fail (channel != NULL, G_IO_ERROR_UNKNOWN);
   g_return_val_if_fail (bytes_read != NULL, G_IO_ERROR_UNKNOWN);
 
+  if (count == 0)
+    {
+      if (bytes_read)
+        *bytes_read = 0;
+      return G_IO_STATUS_NORMAL;
+    }
+
+  g_return_val_if_fail (buf != NULL, G_IO_ERROR_UNKNOWN);
+
   status = channel->funcs->io_read (channel, buf, count, bytes_read, &err);
 
   error = g_io_error_get_from_g_error (status, err);
@@ -550,7 +559,7 @@ g_io_channel_error_from_errno (gint en)
 
 #ifdef EFAULT
     case EFAULT:
-      g_warning("File descriptor outside valid address space.\n");
+      g_warning("Buffer outside valid address space.\n");
       return G_IO_CHANNEL_ERROR_FAILED;
 #endif