Skip to content

Commit

Permalink
Passkey: Fix valgrind error and missing free
Browse files Browse the repository at this point in the history
==367086== Conditional jump or move depends on uninitialised value(s)
==367086==    at 0x12BF1A31: string_get (load.c:894)
==367086==    by 0x12BF291D: stream_get.part.0 (load.c:158)
==367086==    by 0x12BF3182: UnknownInlinedFun (load.c:154)
==367086==    by 0x12BF3182: UnknownInlinedFun (load.c:227)
==367086==    by 0x12BF3182: lex_scan.isra.0 (load.c:573)
==367086==    by 0x12BF7F6A: parse_json (load.c:868)
==367086==    by 0x12BF80C8: json_loads (load.c:920)
==367086==    by 0x12BDDFD9: sss_passkey_message_from_reply_json (passkey_utils.c:544)
==367086==    by 0x12BDCA76: sss_passkeycl_process (passkey_clpreauth.c:321)
==367086==    by 0x4906215: UnknownInlinedFun (preauth2.c:352)
==367086==    by 0x4906215: UnknownInlinedFun (preauth2.c:679)
==367086==    by 0x4906215: k5_preauth (preauth2.c:1018)
==367086==    by 0x48F9489: UnknownInlinedFun (get_in_tkt.c:1351)
==367086==    by 0x48F9489: UnknownInlinedFun (get_in_tkt.c:1912)
==367086==    by 0x48F9489: krb5_init_creds_step (get_in_tkt.c:1868)
==367086==    by 0x48FA43A: k5_init_creds_get (get_in_tkt.c:564)
==367086==    by 0x48FB3EB: k5_get_init_creds (get_in_tkt.c:1978)
==367086==    by 0x48FB817: krb5_get_init_creds_password (gic_pwd.c:210)
  • Loading branch information
justin-stephenson committed Dec 15, 2023
1 parent 830d94e commit 69d5bd2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/krb5_plugin/passkey/passkey_clpreauth.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ sss_passkeycl_exec_child(struct sss_passkey_challenge *data,
int ret = 0;
char *result_creds;

buf = malloc(CHILD_MSG_CHUNK);
buf = calloc(1, CHILD_MSG_CHUNK);
if (buf == NULL) {
ret = ENOMEM;
return ret;
Expand Down Expand Up @@ -361,6 +361,7 @@ sss_passkeycl_process(krb5_context context,

done:
sss_passkey_message_free(reply_message);
sss_passkey_message_free(reply_msg);
sss_passkey_message_free(input_message);
free(reply);
free(prompt_reply);
Expand Down

0 comments on commit 69d5bd2

Please sign in to comment.