diff options
| author | Greg Hudson <ghudson@mit.edu> | 2013-02-09 00:43:35 -0500 |
|---|---|---|
| committer | Greg Hudson <ghudson@mit.edu> | 2013-02-09 00:43:35 -0500 |
| commit | 7905cd6a2eddbf264242bb2a85f811878b2da7ab (patch) | |
| tree | 72b4028cbe0e399e1d293e2b718530913f0a2673 /src/plugins/preauth | |
| parent | 92e2bac0f38f7f60a8fc74b5964357212c4289e1 (diff) | |
| download | krb5-7905cd6a2eddbf264242bb2a85f811878b2da7ab.tar.gz krb5-7905cd6a2eddbf264242bb2a85f811878b2da7ab.tar.xz krb5-7905cd6a2eddbf264242bb2a85f811878b2da7ab.zip | |
Add and use k5memdup, k5memdup0 helpers
Add k5-int.h static functions to duplicate byte ranges, optionally
with a trailing zero byte, and set an error code like k5alloc does.
Use them where they would shorten existing code.
Diffstat (limited to 'src/plugins/preauth')
| -rw-r--r-- | src/plugins/preauth/pkinit/pkinit_srv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/preauth/pkinit/pkinit_srv.c b/src/plugins/preauth/pkinit/pkinit_srv.c index 132eef6653..e379382119 100644 --- a/src/plugins/preauth/pkinit/pkinit_srv.c +++ b/src/plugins/preauth/pkinit/pkinit_srv.c @@ -639,11 +639,11 @@ pkinit_pick_kdf_alg(krb5_context context, krb5_data **kdf_list, tmp_oid = k5alloc(sizeof(krb5_data), &retval); if (retval) goto cleanup; - tmp_oid->data = k5alloc(supp_oid->length, &retval); + tmp_oid->data = k5memdup(supp_oid->data, supp_oid->length, + &retval); if (retval) goto cleanup; tmp_oid->length = supp_oid->length; - memcpy(tmp_oid->data, supp_oid->data, tmp_oid->length); *alg_oid = tmp_oid; /* don't free the OID in clean-up if we are returning it */ tmp_oid = NULL; |
