aboutsummaryrefslogtreecommitdiff
path: root/src/pki.c
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2018-09-11 15:05:41 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-09-17 16:39:38 +0200
commit8f7214a584c7a884ae3714b84451cc51027f98e2 (patch)
treee2aad474cb830d7c718f79b6ed2ca3957ca25477 /src/pki.c
parent9d2de880ec889c4ff3c62380175d9d02f77ad462 (diff)
downloadlibssh-8f7214a584c7a884ae3714b84451cc51027f98e2.tar.gz
libssh-8f7214a584c7a884ae3714b84451cc51027f98e2.tar.xz
libssh-8f7214a584c7a884ae3714b84451cc51027f98e2.zip
pki: Initialize pointers to NULL
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/pki.c')
-rw-r--r--src/pki.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/pki.c b/src/pki.c
index 821df576..e03844c6 100644
--- a/src/pki.c
+++ b/src/pki.c
@@ -813,7 +813,7 @@ ssh_private_key ssh_pki_convert_key_to_privatekey(const ssh_key key) {
static int pki_import_pubkey_buffer(ssh_buffer buffer,
enum ssh_keytypes_e type,
ssh_key *pkey) {
- ssh_key key;
+ ssh_key key = NULL;
int rc;
key = ssh_key_new();
@@ -828,10 +828,10 @@ static int pki_import_pubkey_buffer(ssh_buffer buffer,
switch (type) {
case SSH_KEYTYPE_DSS:
{
- ssh_string p;
- ssh_string q;
- ssh_string g;
- ssh_string pubkey;
+ ssh_string p = NULL;
+ ssh_string q = NULL;
+ ssh_string g = NULL;
+ ssh_string pubkey = NULL;
p = ssh_buffer_get_ssh_string(buffer);
if (p == NULL) {
@@ -886,8 +886,8 @@ static int pki_import_pubkey_buffer(ssh_buffer buffer,
break;
case SSH_KEYTYPE_RSA:
{
- ssh_string e;
- ssh_string n;
+ ssh_string e = NULL;
+ ssh_string n = NULL;
e = ssh_buffer_get_ssh_string(buffer);
if (e == NULL) {
@@ -918,8 +918,8 @@ static int pki_import_pubkey_buffer(ssh_buffer buffer,
#ifdef HAVE_ECC
case SSH_KEYTYPE_ECDSA:
{
- ssh_string e;
- ssh_string i;
+ ssh_string e = NULL;
+ ssh_string i = NULL;
int nid;
i = ssh_buffer_get_ssh_string(buffer);
@@ -1058,8 +1058,8 @@ fail:
int ssh_pki_import_pubkey_base64(const char *b64_key,
enum ssh_keytypes_e type,
ssh_key *pkey) {
- ssh_buffer buffer;
- ssh_string type_s;
+ ssh_buffer buffer = NULL;
+ ssh_string type_s = NULL;
int rc;
if (b64_key == NULL || pkey == NULL) {
@@ -1106,7 +1106,7 @@ int ssh_pki_import_pubkey_base64(const char *b64_key,
*/
int ssh_pki_import_pubkey_blob(const ssh_string key_blob,
ssh_key *pkey) {
- ssh_buffer buffer;
+ ssh_buffer buffer = NULL;
ssh_string type_s = NULL;
enum ssh_keytypes_e type;
int rc;