-
Notifications
You must be signed in to change notification settings - Fork 619
[AutoPR- Security] Patch glib for CVE-2026-1489, CVE-2026-0988 [MEDIUM] #15731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kgodara912
merged 4 commits into
microsoft:main
from
azurelinux-security:azure-autosec/glib/2.0/1043778
Mar 30, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| From 56ec31fed99ea19c123e5266a27f4ea03d25ae15 Mon Sep 17 00:00:00 2001 | ||
| From: Philip Withnall <pwithnall@gnome.org> | ||
| Date: Thu, 18 Dec 2025 23:12:18 +0000 | ||
| Subject: [PATCH] gbufferedinputstream: Fix a potential integer overflow in | ||
| peek() | ||
|
|
||
| If the caller provides `offset` and `count` arguments which overflow, | ||
| their sum will overflow and could lead to `memcpy()` reading out more | ||
| memory than expected. | ||
|
|
||
| Spotted by Codean Labs. | ||
|
|
||
| Signed-off-by: Philip Withnall <pwithnall@gnome.org> | ||
|
|
||
| Fixes: #3851 | ||
| Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> | ||
| Upstream-reference: https://gitlab.gnome.org/GNOME/glib/-/commit/c5766cff61ffce0b8e787eae09908ac348338e5f.patch | ||
| --- | ||
| gio/gbufferedinputstream.c | 2 +- | ||
| gio/tests/buffered-input-stream.c | 10 ++++++++++ | ||
| 2 files changed, 11 insertions(+), 1 deletion(-) | ||
|
|
||
| diff --git a/gio/gbufferedinputstream.c b/gio/gbufferedinputstream.c | ||
| index d9f150d..04c4d9f 100644 | ||
| --- a/gio/gbufferedinputstream.c | ||
| +++ b/gio/gbufferedinputstream.c | ||
| @@ -588,7 +588,7 @@ g_buffered_input_stream_peek (GBufferedInputStream *stream, | ||
|
|
||
| available = g_buffered_input_stream_get_available (stream); | ||
|
|
||
| - if (offset > available) | ||
| + if (offset > available || offset > G_MAXSIZE - count) | ||
| return 0; | ||
|
|
||
| end = MIN (offset + count, available); | ||
| diff --git a/gio/tests/buffered-input-stream.c b/gio/tests/buffered-input-stream.c | ||
| index ee084b3..39b4daf 100644 | ||
| --- a/gio/tests/buffered-input-stream.c | ||
| +++ b/gio/tests/buffered-input-stream.c | ||
| @@ -58,6 +58,16 @@ test_peek (void) | ||
| g_assert_cmpint (npeek, ==, 0); | ||
| g_free (buffer); | ||
|
|
||
| + buffer = g_new0 (char, 64); | ||
| + npeek = g_buffered_input_stream_peek (G_BUFFERED_INPUT_STREAM (in), buffer, 8, 0); | ||
| + g_assert_cmpint (npeek, ==, 0); | ||
| + g_free (buffer); | ||
| + | ||
| + buffer = g_new0 (char, 64); | ||
| + npeek = g_buffered_input_stream_peek (G_BUFFERED_INPUT_STREAM (in), buffer, 5, G_MAXSIZE); | ||
| + g_assert_cmpint (npeek, ==, 0); | ||
| + g_free (buffer); | ||
| + | ||
| g_object_unref (in); | ||
| g_object_unref (base); | ||
| } | ||
| -- | ||
| 2.45.4 | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Queued a test build: link