diff options
-rw-r--r-- | sshsig.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -963,7 +963,7 @@ get_matching_principals_from_line(const char *path, u_long linenum, char *line, | |||
963 | goto done; | 963 | goto done; |
964 | } | 964 | } |
965 | done: | 965 | done: |
966 | if (found) { | 966 | if (found && principalsp != NULL) { |
967 | *principalsp = principals; | 967 | *principalsp = principals; |
968 | principals = NULL; /* transferred */ | 968 | principals = NULL; /* transferred */ |
969 | } | 969 | } |
@@ -1026,8 +1026,8 @@ sshsig_get_pubkey(struct sshbuf *signature, struct sshkey **pubkey) | |||
1026 | struct sshkey *pk = NULL; | 1026 | struct sshkey *pk = NULL; |
1027 | int r = SSH_ERR_SIGNATURE_INVALID; | 1027 | int r = SSH_ERR_SIGNATURE_INVALID; |
1028 | 1028 | ||
1029 | if (pubkey != NULL) | 1029 | if (pubkey == NULL) |
1030 | *pubkey = NULL; | 1030 | return SSH_ERR_INTERNAL_ERROR; |
1031 | if ((r = sshsig_parse_preamble(signature)) != 0) | 1031 | if ((r = sshsig_parse_preamble(signature)) != 0) |
1032 | return r; | 1032 | return r; |
1033 | if ((r = sshkey_froms(signature, &pk)) != 0) | 1033 | if ((r = sshkey_froms(signature, &pk)) != 0) |