* asn1_k_decode.c (asn1_decode_sam_challenge_2_body): Add
authorEzra Peisach <epeisach@mit.edu>
Mon, 23 Dec 2002 18:10:56 +0000 (18:10 +0000)
committerEzra Peisach <epeisach@mit.edu>
Mon, 23 Dec 2002 18:10:56 +0000 (18:10 +0000)
        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

src/lib/krb5/asn.1/ChangeLog
src/lib/krb5/asn.1/asn1_k_decode.c

index 81a841966d2451222d84fba0f4617488acefdd2c..533eb9b442983456b516c6e7241969850dcf3eeb 100644 (file)
@@ -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
index 0a827b1607c10ca969a753516968ae678f0d9e4d..0917d71e283ff841d158aa941e63c979221e37aa 100644 (file)
@@ -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();