diff options
author | Ezra Peisach <epeisach@mit.edu> | 2002-12-23 18:10:56 +0000 |
---|---|---|
committer | Ezra Peisach <epeisach@mit.edu> | 2002-12-23 18:10:56 +0000 |
commit | 211b4c89103d9e49f96c2fdbe642b73ffea0bf8e (patch) | |
tree | 69424409d13babffe56a4ad358c657c364afadbe /src | |
parent | 05402742a68a216b70e0c8b07e7c6b6bc1838984 (diff) | |
download | krb5-211b4c89103d9e49f96c2fdbe642b73ffea0bf8e.tar.gz krb5-211b4c89103d9e49f96c2fdbe642b73ffea0bf8e.tar.xz krb5-211b4c89103d9e49f96c2fdbe642b73ffea0bf8e.zip |
* asn1_k_decode.c (asn1_decode_sam_challenge_2_body): Add
unused_var declaration to cleanup warnings. Signed/unsigned fix as
well.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15068 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/krb5/asn.1/ChangeLog | 6 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/asn1_k_decode.c | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/krb5/asn.1/ChangeLog b/src/lib/krb5/asn.1/ChangeLog index 81a841966d..533eb9b442 100644 --- a/src/lib/krb5/asn.1/ChangeLog +++ b/src/lib/krb5/asn.1/ChangeLog @@ -1,3 +1,9 @@ +2002-12-23 Ezra Peisach <epeisach@bu.edu> + + * asn1_k_decode.c (asn1_decode_sam_challenge_2_body): Add + unused_var declaration to cleanup warnings. Signed/unsigned fix as + well. + 2002-11-07 Ezra Peisach <epeisach@bu.edu> * asn1_k_encode.c (asn1_encode_sam_challenge_2): Test for error diff --git a/src/lib/krb5/asn.1/asn1_k_decode.c b/src/lib/krb5/asn.1/asn1_k_decode.c index 0a827b1607..0917d71e28 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode.c +++ b/src/lib/krb5/asn.1/asn1_k_decode.c @@ -816,19 +816,22 @@ asn1_error_code asn1_decode_sam_challenge_2(asn1buf *buf, krb5_sam_challenge_2 * { setup(); { char *save, *end; + size_t alloclen; begin_structure(); if (tagnum != 0) return ASN1_MISSING_FIELD; if (asn1class != CONTEXT_SPECIFIC || construction != CONSTRUCTED) return ASN1_BAD_ID; save = subbuf.next; { sequence_of_no_tagvars(&subbuf); + unused_var(size); end_sequence_of_no_tagvars(&subbuf); } end = subbuf.next; - if ((val->sam_challenge_2_body.data = (char *) malloc(end - save)) == NULL) + alloclen = end - save; + if ((val->sam_challenge_2_body.data = (char *) malloc(alloclen)) == NULL) return ENOMEM; - val->sam_challenge_2_body.length = end - save; - memcpy(val->sam_challenge_2_body.data, save, end - save); + val->sam_challenge_2_body.length = alloclen; + memcpy(val->sam_challenge_2_body.data, save, alloclen); next_tag(); get_field(val->sam_cksum, 1, asn1_decode_sequence_of_checksum); end_structure(); |