Bug 1192028, Windows bustage fix, variable declarations must go first
authorKai Engert <kaie@kuix.de>
Thu, 15 Oct 2015 20:47:36 +0200
changeset 11659 25cb033147fdec229dd1c7febeef3f10f0af682f
parent 11658 b4feb2cb0ed60b13802cb7d2c489bb355258bd0a
child 11660 1f5f1501b8c4edbd425247a5ba2df9f27500d6da
push id811
push userkaie@kuix.de
push dateThu, 15 Oct 2015 18:47:50 +0000
bugs1192028
Bug 1192028, Windows bustage fix, variable declarations must go first
lib/util/secasn1d.c
--- a/lib/util/secasn1d.c
+++ b/lib/util/secasn1d.c
@@ -980,16 +980,17 @@ sec_asn1d_check_and_subtract_length (uns
 }
 
 static void
 sec_asn1d_prepare_for_contents (sec_asn1d_state *state)
 {
     SECItem *item;
     PLArenaPool *poolp;
     unsigned long alloc_len;
+    sec_asn1d_state *parent;
 
 #ifdef DEBUG_ASN1D_STATES
     {
         printf("Found Length %d %s\n", state->contents_length,
                state->indefinite ? "indefinite" : "");
     }
 #endif
 
@@ -1015,17 +1016,17 @@ sec_asn1d_prepare_for_contents (sec_asn1
      * It's slightly complicated by the need to account both for integer
      * underflow and overflow, as well as ensure that for indefinite length
      * encodings, there's also enough space for the End-of-Contents (EOC)
      * octets (Tag = 0x00, Length = 0x00, or two bytes).
      */
 
     /* Determine the maximum length available for this element by finding the
      * first definite length ancestor, if any. */
-    sec_asn1d_state *parent = sec_asn1d_get_enclosing_construct(state);
+    parent = sec_asn1d_get_enclosing_construct(state);
     while (parent && parent->indefinite) {
         parent = sec_asn1d_get_enclosing_construct(parent);
     }
     /* If parent is null, state is either the outermost state / at the top of
      * the stack, or the outermost state uses indefinite length encoding. In
      * these cases, there's nothing external to constrain this element, so
      * there's nothing to check. */
     if (parent) {