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/lib/krb5/rcache | |
parent | 92e2bac0f38f7f60a8fc74b5964357212c4289e1 (diff) | |
download | krb5-7905cd6a2eddbf264242bb2a85f811878b2da7ab.zip krb5-7905cd6a2eddbf264242bb2a85f811878b2da7ab.tar.gz krb5-7905cd6a2eddbf264242bb2a85f811878b2da7ab.tar.bz2 |
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/lib/krb5/rcache')
-rw-r--r-- | src/lib/krb5/rcache/rc_dfl.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/krb5/rcache/rc_dfl.c b/src/lib/krb5/rcache/rc_dfl.c index cc42f46..2981985 100644 --- a/src/lib/krb5/rcache/rc_dfl.c +++ b/src/lib/krb5/rcache/rc_dfl.c @@ -419,11 +419,9 @@ check_hash_extension(krb5_donot_replay *rep) end = strchr(str, ' '); if (!end) return 0; - msghash = malloc(end - str + 1); + msghash = k5memdup0(str, end - str, &retval); if (!msghash) return KRB5_RC_MALLOC; - memcpy(msghash, str, end - str); - msghash[end - str] = '\0'; str = end + 1; /* Parse out the client and server. */ |