avoid creating negative values out of unsigned values using MAX, check to
authorManish Singh <yosh@gimp.org>
Fri, 18 Oct 2002 20:43:56 +0000 (20:43 +0000)
committerManish Singh <yosh@src.gnome.org>
Fri, 18 Oct 2002 20:43:56 +0000 (20:43 +0000)
Fri Oct 18 13:41:30 2002  Manish Singh  <yosh@gimp.org>

        * glib/giochannel.c (g_io_channel_read_line_backend): avoid
        creating negative values out of unsigned values using MAX,
        check to see if the result would be positive before doing
        the calculation.

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

index 04c64f7..9756bfe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri Oct 18 13:41:30 2002  Manish Singh  <yosh@gimp.org>
+
+       * glib/giochannel.c (g_io_channel_read_line_backend): avoid
+       creating negative values out of unsigned values using MAX,
+       check to see if the result would be positive before doing
+       the calculation.
+
 Tue Oct 15 15:28:47 2002  Manish Singh  <yosh@gimp.org>
 
        * tests/iochannel-test.c: use gsize instead of int where appropriate
index 04c64f7..9756bfe 100644 (file)
@@ -1,3 +1,10 @@
+Fri Oct 18 13:41:30 2002  Manish Singh  <yosh@gimp.org>
+
+       * glib/giochannel.c (g_io_channel_read_line_backend): avoid
+       creating negative values out of unsigned values using MAX,
+       check to see if the result would be positive before doing
+       the calculation.
+
 Tue Oct 15 15:28:47 2002  Manish Singh  <yosh@gimp.org>
 
        * tests/iochannel-test.c: use gsize instead of int where appropriate
index 04c64f7..9756bfe 100644 (file)
@@ -1,3 +1,10 @@
+Fri Oct 18 13:41:30 2002  Manish Singh  <yosh@gimp.org>
+
+       * glib/giochannel.c (g_io_channel_read_line_backend): avoid
+       creating negative values out of unsigned values using MAX,
+       check to see if the result would be positive before doing
+       the calculation.
+
 Tue Oct 15 15:28:47 2002  Manish Singh  <yosh@gimp.org>
 
        * tests/iochannel-test.c: use gsize instead of int where appropriate
index 04c64f7..9756bfe 100644 (file)
@@ -1,3 +1,10 @@
+Fri Oct 18 13:41:30 2002  Manish Singh  <yosh@gimp.org>
+
+       * glib/giochannel.c (g_io_channel_read_line_backend): avoid
+       creating negative values out of unsigned values using MAX,
+       check to see if the result would be positive before doing
+       the calculation.
+
 Tue Oct 15 15:28:47 2002  Manish Singh  <yosh@gimp.org>
 
        * tests/iochannel-test.c: use gsize instead of int where appropriate
index 04c64f7..9756bfe 100644 (file)
@@ -1,3 +1,10 @@
+Fri Oct 18 13:41:30 2002  Manish Singh  <yosh@gimp.org>
+
+       * glib/giochannel.c (g_io_channel_read_line_backend): avoid
+       creating negative values out of unsigned values using MAX,
+       check to see if the result would be positive before doing
+       the calculation.
+
 Tue Oct 15 15:28:47 2002  Manish Singh  <yosh@gimp.org>
 
        * tests/iochannel-test.c: use gsize instead of int where appropriate
index 04c64f7..9756bfe 100644 (file)
@@ -1,3 +1,10 @@
+Fri Oct 18 13:41:30 2002  Manish Singh  <yosh@gimp.org>
+
+       * glib/giochannel.c (g_io_channel_read_line_backend): avoid
+       creating negative values out of unsigned values using MAX,
+       check to see if the result would be positive before doing
+       the calculation.
+
 Tue Oct 15 15:28:47 2002  Manish Singh  <yosh@gimp.org>
 
        * tests/iochannel-test.c: use gsize instead of int where appropriate
index 04c64f7..9756bfe 100644 (file)
@@ -1,3 +1,10 @@
+Fri Oct 18 13:41:30 2002  Manish Singh  <yosh@gimp.org>
+
+       * glib/giochannel.c (g_io_channel_read_line_backend): avoid
+       creating negative values out of unsigned values using MAX,
+       check to see if the result would be positive before doing
+       the calculation.
+
 Tue Oct 15 15:28:47 2002  Manish Singh  <yosh@gimp.org>
 
        * tests/iochannel-test.c: use gsize instead of int where appropriate
index 5c19876..b463a24 100644 (file)
@@ -1600,7 +1600,10 @@ read_again:
           break;
         }
 
-      checked_to = MAX (use_buf->len - (line_term_len - 1), 0);
+      if (use_buf->len > line_term_len - 1)
+       checked_to = use_buf->len - (line_term_len - 1);
+      else
+       checked_to = 0;
     }
 
 done: