diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-09-10 03:05:12 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-09-10 03:05:12 +0000 |
| commit | 2bc2b430bc4c1a9a0bfd1c01da68bd53bf7da052 (patch) | |
| tree | a2af4fd609c7decacbf0ea11926ea338596fb179 /backport-Fix-possible-NULL-pointer-dereference-in-rpmfcClassi.patch | |
| parent | 0ae9f87336a3d78d8fbc0a1e5c75cba5f9cf8597 (diff) | |
automatic import of rpm
Diffstat (limited to 'backport-Fix-possible-NULL-pointer-dereference-in-rpmfcClassi.patch')
| -rw-r--r-- | backport-Fix-possible-NULL-pointer-dereference-in-rpmfcClassi.patch | 39 |
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 + |
