Blame SOURCES/0004-Fix-microdnf---help-coredump.patch
|
|
5b2e17 |
From 1701ad8ccccae6f8867a862e074ca30f6583e69f Mon Sep 17 00:00:00 2001
|
|
|
5b2e17 |
From: Jaroslav Rohel <jrohel@redhat.com>
|
|
|
5b2e17 |
Date: Fri, 23 Aug 2019 12:42:42 +0200
|
|
|
5b2e17 |
Subject: [PATCH] Fix "microdnf --help" coredump
|
|
|
5b2e17 |
|
|
|
5b2e17 |
There was a bug that causes coredump during comand "microdnf --help".
|
|
|
5b2e17 |
The bug was in the code that removes the directory path from argv[0]
|
|
|
5b2e17 |
(in case argv[0] does not contain '/' character).
|
|
|
5b2e17 |
---
|
|
|
5b2e17 |
dnf/dnf-main.c | 4 ++--
|
|
|
5b2e17 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
5b2e17 |
|
|
|
5b2e17 |
diff --git a/dnf/dnf-main.c b/dnf/dnf-main.c
|
|
|
5b2e17 |
index e35ace0..7c71bd0 100644
|
|
|
5b2e17 |
--- a/dnf/dnf-main.c
|
|
|
5b2e17 |
+++ b/dnf/dnf-main.c
|
|
|
5b2e17 |
@@ -298,8 +298,8 @@ main (int argc,
|
|
|
5b2e17 |
|
|
|
5b2e17 |
if (cmd_name == NULL && show_help)
|
|
|
5b2e17 |
{
|
|
|
5b2e17 |
- const char *prg_name = strrchr(argv[0], '/') + 1;
|
|
|
5b2e17 |
- prg_name = prg_name ? prg_name : argv[0];
|
|
|
5b2e17 |
+ const char *prg_name = strrchr(argv[0], '/');
|
|
|
5b2e17 |
+ prg_name = prg_name ? prg_name + 1 : argv[0];
|
|
|
5b2e17 |
|
|
|
5b2e17 |
g_set_prgname (prg_name);
|
|
|
5b2e17 |
g_autofree gchar *help = g_option_context_get_help (opt_ctx, TRUE, NULL);
|
|
|
5b2e17 |
--
|
|
|
5b2e17 |
2.24.0
|
|
|
5b2e17 |
|