avoid creating negative values out of unsigned values using MAX, check to

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.
This commit is contained in:
Manish Singh 2002-10-18 20:43:56 +00:00 committed by Manish Singh
parent ac1080ee3b
commit 55a39b8033
8 changed files with 53 additions and 1 deletions

View 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> Tue Oct 15 15:28:47 2002 Manish Singh <yosh@gimp.org>
* tests/iochannel-test.c: use gsize instead of int where appropriate * tests/iochannel-test.c: use gsize instead of int where appropriate

View 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> Tue Oct 15 15:28:47 2002 Manish Singh <yosh@gimp.org>
* tests/iochannel-test.c: use gsize instead of int where appropriate * tests/iochannel-test.c: use gsize instead of int where appropriate

View 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> Tue Oct 15 15:28:47 2002 Manish Singh <yosh@gimp.org>
* tests/iochannel-test.c: use gsize instead of int where appropriate * tests/iochannel-test.c: use gsize instead of int where appropriate

View 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> Tue Oct 15 15:28:47 2002 Manish Singh <yosh@gimp.org>
* tests/iochannel-test.c: use gsize instead of int where appropriate * tests/iochannel-test.c: use gsize instead of int where appropriate

View 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> Tue Oct 15 15:28:47 2002 Manish Singh <yosh@gimp.org>
* tests/iochannel-test.c: use gsize instead of int where appropriate * tests/iochannel-test.c: use gsize instead of int where appropriate

View 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> Tue Oct 15 15:28:47 2002 Manish Singh <yosh@gimp.org>
* tests/iochannel-test.c: use gsize instead of int where appropriate * tests/iochannel-test.c: use gsize instead of int where appropriate

View 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> Tue Oct 15 15:28:47 2002 Manish Singh <yosh@gimp.org>
* tests/iochannel-test.c: use gsize instead of int where appropriate * tests/iochannel-test.c: use gsize instead of int where appropriate

View File

@ -1600,7 +1600,10 @@ read_again:
break; 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: done: