giochannel: Don't store negative line_term_len in GIOChannel struct

Adding test coverage indicated that this was another bug in 0cc11f74.

Fixes: 0cc11f74 "giochannel: Forbid very long line terminator strings"
Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/2323
Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2021-02-08 10:34:50 +00:00
parent a149bf2f90
commit 5dc8b0014c

View File

@ -905,7 +905,7 @@ g_io_channel_set_line_term (GIOChannel *channel,
g_free (channel->line_term);
channel->line_term = line_term ? g_memdup2 (line_term, length_unsigned) : NULL;
channel->line_term_len = length;
channel->line_term_len = length_unsigned;
}
/**