abrt/0002-applet-application-Fix-use-after-free.patch
Matej Marusak 8086e64036 Fix use after free in applet
Fixes BZ#1665521

Signed-off-by: Matej Marusak <mmarusak@redhat.com>
2019-01-12 12:39:07 +01:00

39 lines
1.2 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From cf78b299371995cbd7607a536f4b1469c09b40cf Mon Sep 17 00:00:00 2001
From: Ernestas Kulik <ekulik@redhat.com>
Date: Sat, 12 Jan 2019 10:50:24 +0100
Subject: [PATCH] applet: application: Fix use after free
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
dirlist_name is erroneously freed before its used to create a
directory.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1665521
Signed-off-by: Ernestas Kulik <ekulik@redhat.com>
---
src/applet/abrt-applet-application.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/applet/abrt-applet-application.c b/src/applet/abrt-applet-application.c
index 6e7ac00a..4b1d9a3c 100644
--- a/src/applet/abrt-applet-application.c
+++ b/src/applet/abrt-applet-application.c
@@ -296,10 +296,10 @@ new_dir_exists (GList **new_dirs)
cachedir = g_get_user_cache_dir ();
dirlist_name = concat_path_file (cachedir, "abrt");
- g_free (dirlist_name);
-
g_mkdir_with_parents (dirlist_name, 0777);
+ g_free (dirlist_name);
+
dirlist_name = concat_path_file (cachedir, "abrt/applet_dirlist");
fp = fopen (dirlist_name, "r+");
if (fp == NULL)
--
2.20.1