summaryrefslogtreecommitdiff
path: root/backport-Fix-memory-leak-in-pgpPrtParams-1.patch
diff options
context:
space:
mode:
Diffstat (limited to 'backport-Fix-memory-leak-in-pgpPrtParams-1.patch')
-rw-r--r--backport-Fix-memory-leak-in-pgpPrtParams-1.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/backport-Fix-memory-leak-in-pgpPrtParams-1.patch b/backport-Fix-memory-leak-in-pgpPrtParams-1.patch
new file mode 100644
index 0000000..16e5cca
--- /dev/null
+++ b/backport-Fix-memory-leak-in-pgpPrtParams-1.patch
@@ -0,0 +1,25 @@
+From 10ac962bf2f71af927c8eaaea427135441663497 Mon Sep 17 00:00:00 2001
+From: Demi Marie Obenour <demi@invisiblethingslab.com>
+Date: Thu, 17 Mar 2022 03:16:59 -0400
+Subject: [PATCH] Fix memory leak in pgpPrtParams()
+
+Found by leak sanitizer on a fuzzed test case.
+---
+ rpmio/rpmpgp.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c
+index eb5701b..f9e2658 100644
+--- a/rpmio/rpmpgp.c
++++ b/rpmio/rpmpgp.c
+@@ -1163,6 +1163,7 @@ int pgpPrtParams(const uint8_t * pkts, size_t pktlen, unsigned int pkttype,
+ rc = (digp && (p == pend) && expect == 0) ? 0 : -1;
+
+ free(all);
++ selfsig = pgpDigParamsFree(selfsig);
+ if (ret && rc == 0) {
+ *ret = digp;
+ } else {
+--
+1.8.3.1
+