From 07e79f26a4809bcbafad2f4fd877a43e57195839 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 10 Feb 2009 21:29:56 +0000 Subject: [PATCH] Revert prev commit --- libraries/liblber/decode.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libraries/liblber/decode.c b/libraries/liblber/decode.c index 3e956804b5..b687e75cc8 100644 --- a/libraries/liblber/decode.c +++ b/libraries/liblber/decode.c @@ -143,14 +143,13 @@ ber_skip_tag( BerElement *ber, ber_len_t *len ) { ber_tag_t tag; unsigned char lc; - char *save; + ber_len_t i, noctets; + unsigned char netlen[sizeof(ber_len_t)]; assert( ber != NULL ); assert( len != NULL ); assert( LBER_VALID( ber ) ); - save = ber->ber_ptr; - /* * Any ber element looks like this: tag length contents. * Assuming everything's ok, we return the tag byte (we @@ -183,9 +182,6 @@ ber_skip_tag( BerElement *ber, ber_len_t *len ) } if ( lc & 0x80U ) { - ber_len_t i, noctets; - unsigned char netlen[sizeof(ber_len_t)]; - noctets = (lc & 0x7fU); if ( noctets > sizeof(ber_len_t) ) { @@ -206,7 +202,7 @@ ber_skip_tag( BerElement *ber, ber_len_t *len ) } /* BER element should have enough data left */ - if( *len > (ber_len_t) (ber_pvt_ber_remaining( ber ) + ber->ber_ptr - save) ) { + if( *len > (ber_len_t) ber_pvt_ber_remaining( ber ) ) { return LBER_DEFAULT; } ber->ber_tag = *(unsigned char *)ber->ber_ptr; -- 2.39.5