[glib: 1/4] giochannel: Fix length_size bounds check
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/4] giochannel: Fix length_size bounds check
- Date: Mon, 8 Feb 2021 11:07:00 +0000 (UTC)
commit a149bf2f9030168051942124536e303af8ba6176
Author: Jan Alexander Steffens (heftig) <jan steffens gmail com>
Date: Sun Feb 7 23:32:40 2021 +0100
giochannel: Fix length_size bounds check
The inverted condition is an obvious error introduced by ecdf91400e9a.
Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/2323
glib/giochannel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/giochannel.c b/glib/giochannel.c
index 4c5e081ed..8516c0b5e 100644
--- a/glib/giochannel.c
+++ b/glib/giochannel.c
@@ -899,7 +899,7 @@ g_io_channel_set_line_term (GIOChannel *channel,
{
/* FIXME: We’re constrained by line_term_len being a guint here */
gsize length_size = strlen (line_term);
- g_return_if_fail (length_size > G_MAXUINT);
+ g_return_if_fail (length_size <= G_MAXUINT);
length_unsigned = (guint) length_size;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]