[krbdev.mit.edu #5704] new warnings in pkinit code (patch needs review)

Ken Raeburn via RT rt-comment at krbdev.mit.edu
Wed Aug 29 20:53:54 EDT 2007


From: 	  raeburn at MIT.EDU
Date: 	August 8, 2007 1:30:01 EDT
To: 	  kwc at citi.umich.edu
Cc: 	  krbdev at mit.edu

lib/krb5/asn.1/asn1_k_decode.c: In function 'asn1_decode_algorithm_identifier':
lib/krb5/asn.1/asn1_k_decode.c:1346: warning: 'asn1class' is used uninitialized in this 
function
lib/krb5/asn.1/asn1_k_decode.c:1346: warning: 'tagnum' is used uninitialized in this 
function
lib/krb5/asn.1/asn1_k_decode.c:1346: warning: 'indef' is used uninitialized in this function

It looks to me like these values will control how the processing is done at the end of the 
structure (e.g., whether to look for the tail end of an indefinite encoding), so leaving them 
uninitialized is a bad idea.

Ken

From: 	  kwc at citi.umich.edu
Date: 	August 8, 2007 15:58:29 EDT
To: 	  raeburn at mit.edu
Cc: 	  krbdev at mit.edu

[...quotations elided...]
Can someone (Tom?) look at this and comment whether these are the
right values to use.

Thanks,
K.C.

Index: asn1_k_decode.c
=========================================================
==========
--- asn1_k_decode.c     (revision 19759)
+++ asn1_k_decode.c     (working copy)
@@ -1343,6 +1343,11 @@
       val->parameters.length = size;
     }

+    /* There is no tag, so we set these just in case seqindef is nonzero */
+    tagnum = ASN1_TAGNUM_CEILING;
+    asn1class = UNIVERSAL;
+    indef = 0;
+
     end_structure();
   }
   cleanup();




More information about the krb5-bugs mailing list