[Pkg-gnupg-commit] [gnupg2] 148/159: g10: Fix segfault on unsupported curve.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Jan 27 13:24:04 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit b8bb16c6c08d3c2947f1ff67419b36eb203c5c1a
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Tue Jan 26 11:12:33 2016 +0900

    g10: Fix segfault on unsupported curve.
    
    * g10/call-agent.c (learn_status_cb): Don't use NULL for strcmp.
    --
    
    With libgcrypt not supporting cv25519, gpg segfaults.
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
---
 g10/call-agent.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/g10/call-agent.c b/g10/call-agent.c
index 1d7ff57..d9e4859 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -701,14 +701,10 @@ learn_status_cb (void *opaque, const char *line)
         {
           const char *curve;
 
-          i = 0;
-          do
-            {
-              curve = openpgp_enum_curves (&i);
-              if (!strcmp (curve, line+n))
-                break;
-            }
-          while (curve != NULL);
+          for (i = 0; (curve = openpgp_enum_curves (&i));)
+            if (!strcmp (curve, line+n))
+              break;
+
           parm->key_attr[keyno].curve = curve;
         }
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list