dirmngr: Fix segfault in ldap engine
authorKristian Fiskerstrand <kf@sumptuouscapital.com>
Sat, 11 Apr 2015 23:11:07 +0000 (01:11 +0200)
committerNeal H. Walfield <neal@g10code.com>
Thu, 7 May 2015 13:03:28 +0000 (15:03 +0200)
(ks-engine-ldap.c) Fix segfault caused by missing check whether uri is
initialized

dirmngr/ks-engine-ldap.c

index aefd12a..4288119 100644 (file)
@@ -306,7 +306,9 @@ ks_ldap_help (ctrl_t ctrl, parsed_uri_t uri)
     "Supported methods: search, get, put\n";
   gpg_error_t err;
 
-  if (strcmp (uri->scheme, "ldap") == 0
+  if(!uri)
+    err = ks_print_help (ctrl, "  ldap");
+  else if (strcmp (uri->scheme, "ldap") == 0
       || strcmp (uri->scheme, "ldaps") == 0
       || strcmp (uri->scheme, "ldapi") == 0)
     err = ks_print_help (ctrl, data);