public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gdb] gdb-17.2-rebase-f44: Backport [gdb] Improve early exits for env var in debuginfod-support.c
@ 2026-06-28 0:00 Bruno Larsen
0 siblings, 0 replies; only message in thread
From: Bruno Larsen @ 2026-06-28 0:00 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/gdb
Branch : gdb-17.2-rebase-f44
Commit : 170c3b942c90d18a6e2802c5969b5bd7da90a039
Author : Bruno Larsen <blarsen@redhat.com>
Date : 2021-09-23T15:25:14-03:00
Stats : +61/-0 in 5 file(s)
URL : https://src.fedoraproject.org/rpms/gdb/c/170c3b942c90d18a6e2802c5969b5bd7da90a039?branch=gdb-17.2-rebase-f44
Log:
Backport [gdb] Improve early exits for env var in debuginfod-support.c
(Tom de Vries)
Resolves: RHBZ 1970741
---
diff --git a/_gdb.spec.Patch.include b/_gdb.spec.Patch.include
index bd3f136..f5491b4 100644
--- a/_gdb.spec.Patch.include
+++ b/_gdb.spec.Patch.include
@@ -407,3 +407,7 @@ Patch098: gdb-rhbz1971096-glibc2.34-5.patch
#(Tom de Vries)
Patch099: gdb-rhbz1916516-pathstuffs132-internal-error.patch
+#[gdb] Improve early exits for env var in debuginfod-support.c
+#(Tom de Vries)
+Patch100: gdb-rhbz1970741-early-exit-for-empty-debuginfod-url.patch
+
diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include
index dddd45a..fd3cf02 100644
--- a/_gdb.spec.patch.include
+++ b/_gdb.spec.patch.include
@@ -97,3 +97,4 @@
%patch097 -p1
%patch098 -p1
%patch099 -p1
+%patch100 -p1
diff --git a/_patch_order b/_patch_order
index 15fcc3c..33496b1 100644
--- a/_patch_order
+++ b/_patch_order
@@ -97,3 +97,4 @@ gdb-rhbz1971096-glibc2.34-3.patch
gdb-rhbz1971096-glibc2.34-4.patch
gdb-rhbz1971096-glibc2.34-5.patch
gdb-rhbz1916516-pathstuffs132-internal-error.patch
+gdb-rhbz1970741-early-exit-for-empty-debuginfod-url.patch
diff --git a/gdb-rhbz1970741-early-exit-for-empty-debuginfod-url.patch b/gdb-rhbz1970741-early-exit-for-empty-debuginfod-url.patch
new file mode 100644
index 0000000..a678b04
--- /dev/null
+++ b/gdb-rhbz1970741-early-exit-for-empty-debuginfod-url.patch
@@ -0,0 +1,51 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Bruno Larsen <blarsen@redhat.com>
+Date: Wed, 22 Sep 2021 12:29:11 -0300
+Subject: gdb-rhbz1970741-early-exit-for-empty-debuginfod-url.patch
+
+;;[gdb] Improve early exits for env var in debuginfod-support.c
+;;(Tom de Vries)
+
+There's an early exit in libdebuginfod's debuginfod_query_server, which checks
+both for:
+- getenv (DEBUGINFOD_URLS_ENV_VAR) == NULL, and
+- (getenv (DEBUGINFOD_URLS_ENV_VAR))[0] == '\0'.
+
+In debuginfod_source_query and debuginfod_debuginfo_query (which both
+end up calling debuginfod_query_server) there are also early exits checking
+the same env var, but those just check for NULL.
+
+Make the early exit tests in debuginfod-support.c match those in
+libdebuginfod.
+
+gdb/ChangeLog:
+
+2020-11-18 Tom de Vries <tdevries@suse.de>
+
+ * debuginfod-support.c (debuginfod_source_query)
+ (debuginfod_debuginfo_query): Also do early exit if
+ "(getenv (DEBUGINFOD_URLS_ENV_VAR))[0] == '\0'".
+
+diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c
+--- a/gdb/debuginfod-support.c
++++ b/gdb/debuginfod-support.c
+@@ -98,7 +98,8 @@ debuginfod_source_query (const unsigned char *build_id,
+ const char *srcpath,
+ gdb::unique_xmalloc_ptr<char> *destname)
+ {
+- if (getenv (DEBUGINFOD_URLS_ENV_VAR) == NULL)
++ const char *urls_env_var = getenv (DEBUGINFOD_URLS_ENV_VAR);
++ if (urls_env_var == NULL || urls_env_var[0] == '\0')
+ return scoped_fd (-ENOSYS);
+
+ debuginfod_client *c = debuginfod_init ();
+@@ -135,7 +136,8 @@ debuginfod_debuginfo_query (const unsigned char *build_id,
+ const char *filename,
+ gdb::unique_xmalloc_ptr<char> *destname)
+ {
+- if (getenv (DEBUGINFOD_URLS_ENV_VAR) == NULL)
++ const char *urls_env_var = getenv (DEBUGINFOD_URLS_ENV_VAR);
++ if (urls_env_var == NULL || urls_env_var[0] == '\0')
+ return scoped_fd (-ENOSYS);
+
+ debuginfod_client *c = debuginfod_init ();
diff --git a/gdb.spec b/gdb.spec
index 010207b..340e2d5 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -1144,6 +1144,10 @@ fi
%changelog
* Wed Sep 22 2021 Bruno Larsen <blarsen@redhat.com> - 10.2-8
+- Backport "[gdb] Improve early exits for env var in debuginfod-support.c"
+ (Tom de Vries)
+
+* Wed Sep 22 2021 Bruno Larsen <blarsen@redhat.com> - 10.2-8
- Backport "[gdb/cli] Don't assert on empty string for core-file"
(Tom de Vries)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-28 0:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-28 0:00 [rpms/gdb] gdb-17.2-rebase-f44: Backport [gdb] Improve early exits for env var in debuginfod-support.c Bruno Larsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox