summaryrefslogtreecommitdiff
path: root/backport-Fix-possible-NULL-pointer-dereference-in-rpmfcClassi.patch
diff options
context:
space:
mode:
Diffstat (limited to 'backport-Fix-possible-NULL-pointer-dereference-in-rpmfcClassi.patch')
-rw-r--r--backport-Fix-possible-NULL-pointer-dereference-in-rpmfcClassi.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/backport-Fix-possible-NULL-pointer-dereference-in-rpmfcClassi.patch b/backport-Fix-possible-NULL-pointer-dereference-in-rpmfcClassi.patch
new file mode 100644
index 0000000..cb718a4
--- /dev/null
+++ b/backport-Fix-possible-NULL-pointer-dereference-in-rpmfcClassi.patch
@@ -0,0 +1,39 @@
+From 1c15d748d3536a21b6edbbf9254db76fefb4b275 Mon Sep 17 00:00:00 2001
+From: Dmitry Gerasimov <d.gerasimov@omp.ru>
+Date: Mon, 27 Dec 2021 12:27:57 +0300
+Subject: [PATCH] Fix possible NULL pointer dereference in rpmfcClassify
+
+Here is simplified overview of possible dereference:
+
+ if (fc == NULL) {
+ rpmlog(RPMLOG_ERR, _("Empty file classifier\n"));
+ goto exit;
+ }
+
+ // ...
+
+ exit:
+ rpmstrPoolFreeze(fc->cdict, 0);
+ ~~~~~~~~~
+
+This issue was found by Svace Static Analyzer.
+---
+ build/rpmfc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/rpmfc.c b/build/rpmfc.c
+index eb51a36..cf2c203 100644
+--- a/build/rpmfc.c
++++ b/build/rpmfc.c
+@@ -1168,7 +1168,7 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode)
+
+ if (fc == NULL) {
+ rpmlog(RPMLOG_ERR, _("Empty file classifier\n"));
+- goto exit;
++ return RPMRC_FAIL;
+ }
+
+ /* It is OK when we have no files to classify. */
+--
+1.8.3.1
+