[esnacc-dev] [PATCH 3/4] c-lib: Fix the AsnBitsEquiv

Aaron Conole aconole at bytheb.org
Wed Dec 14 15:24:49 UTC 2016


The AsnBitsEquiv() has always compared b1 with b1 for the final octet
bits.  It should have been b1 with b2.  This was exposed by the cleanups
in commit 4279ddf7d111 ("c-lib: Remove unneeded config.h references").

Signed-off-by: Aaron Conole <aconole at bytheb.org>
---
NOTE: The fix expressed here will be included on branch-1.8 for a possible 1.8.2
      release.

 c-lib/src/asn-bits.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/c-lib/src/asn-bits.c b/c-lib/src/asn-bits.c
index 6bafc08..d2b3660 100644
--- a/c-lib/src/asn-bits.c
+++ b/c-lib/src/asn-bits.c
@@ -349,7 +349,7 @@ AsnBitsEquiv PARAMS ((b1, b2),
     return b1->bitLen == b2->bitLen &&
         !memcmp(b1->bits, b2->bits, octetsLessOne) &&
         ((b1->bits[octetsLessOne] & (0xFF << unusedBits)) ==
-         (b1->bits[octetsLessOne] & (0xFF << unusedBits)));
+         (b2->bits[octetsLessOne] & (0xFF << unusedBits)));
 
 } /* AsnBitsEquiv */
 
-- 
2.7.4




More information about the dev mailing list