Package: gnupg2 / 2.0.26-6+deb8u2

0038-scd-Avoid-double-free-on-error-condition-in-scd.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 0fd4cd8503dfe9c3e6a362003bd647b4cd882363 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Fri, 19 Dec 2014 18:07:55 -0500
Subject: [PATCH 38/56] scd: Avoid double-free on error condition in scd

* scd/command.c (cmd_readkey): avoid double-free of cert

--

When ksba_cert_new() fails, cert will be double-freed.

Debian-Bug-Id: 773471

Original patch changed by wk to do the free only at leave.
---
 scd/command.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/scd/command.c b/scd/command.c
index fc1f5a2..b26bd68 100644
--- a/scd/command.c
+++ b/scd/command.c
@@ -777,10 +777,8 @@ cmd_readkey (assuan_context_t ctx, char *line)
 
   rc = ksba_cert_new (&kc);
   if (rc)
-    {
-      xfree (cert);
-      goto leave;
-    }
+    goto leave;
+
   rc = ksba_cert_init_from_mem (kc, cert, ncert);
   if (rc)
     {
-- 
2.1.4