File: gutils-Handle-huge-lines-in-load_user_special_dirs.patch

package info (click to toggle)
glib2.0 2.86.0-6
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 74,852 kB
  • sloc: ansic: 544,570; python: 9,702; sh: 1,612; xml: 1,482; perl: 1,222; cpp: 535; makefile: 321; javascript: 11
file content (25 lines) | stat: -rw-r--r-- 743 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From: Tobias Stoeckmann <tobias@stoeckmann.org>
Date: Thu, 11 Sep 2025 19:25:25 +0200
Subject: gutils: Handle huge lines in load_user_special_dirs

If a line is longer than G_INTMAX, still treat it correctly without
possibly provoking an out of boundary read.

Origin: upstream, 2.86.1, commit:300722b6c42639891bc37cab0de0e03fb2a9e127
---
 glib/gutils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/glib/gutils.c b/glib/gutils.c
index 6ff9c79..3102b07 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -2293,7 +2293,7 @@ load_user_special_dirs (void)
     {
       gchar *buffer = lines[i];
       gchar *d, *p;
-      gint len;
+      size_t len;
       gboolean is_relative = FALSE;
       GUserDirectory directory;