Backport fix for CVE-2026-58013 to glib2-2.56.4. The patch
fixes a buffer over-read in giochannel.c where memcmp()
could read past the end of the buffer when a multi-byte
line terminator is used and the line extends to the end of
the buffer. A bounds check is added before the memcmp()
call. A minimal test file (io-channel.c) is included,
adapted for 2.56.4 API compatibility.
CVE: CVE-2026-58013
Upstream patches:
- 9f557746c5.patch
Resolves: RHEL-212229
This commit was backported by Ymir, a Red Hat Enterprise Linux software maintenance AI agent.
Assisted-by: Ymir