From Matthijs Melchior: when setting "eoc" in "asn1_bits_decode()", get
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 24 Jun 2003 06:05:47 +0000 (06:05 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 24 Jun 2003 06:05:47 +0000 (06:05 +0000)
the offset from before the byte with the number of unused bits is
fetched, so that we count that byte.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7920 f5534014-38df-0310-8fa8-9805f1628bb7

asn1.c

diff --git a/asn1.c b/asn1.c
index 709b070a7804fc2ab893dd3c9c86acef230d5dd2..e3bf728548ae7a1fe868112f81eb51e01700ad6b 100644 (file)
--- a/asn1.c
+++ b/asn1.c
@@ -1,7 +1,7 @@
 /* asn1.c
  * Routines for ASN.1 BER dissection
  *
- * $Id: asn1.c,v 1.19 2003/05/10 02:00:41 guy Exp $
+ * $Id: asn1.c,v 1.20 2003/06/24 06:05:47 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -607,6 +607,7 @@ asn1_bits_decode ( ASN1_SCK *asn1, int enc_len, guchar **bits,
     int eoc;
     guchar *ptr;
 
+    eoc = asn1->offset + enc_len;
     *bits = NULL;
     ret = asn1_octet_decode (asn1, unused);
     if (ret != ASN1_ERR_NOERROR)
@@ -634,7 +635,6 @@ asn1_bits_decode ( ASN1_SCK *asn1, int enc_len, guchar **bits,
        *bits = g_malloc (1);
     }
 
-    eoc = asn1->offset + enc_len;
     ptr = *bits;
     while (asn1->offset < eoc) {
         ret = asn1_octet_decode (asn1, (guchar *)ptr++);