From da5673c71a3e72d91cd673829f4ca818e334ac23 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 25 Apr 2000 10:42:32 +0000 Subject: [PATCH] Apply experimental multibyte tag fix --- libraries/liblber/decode.c | 12 ++++++------ libraries/liblber/liblber.dsp | 6 ++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/libraries/liblber/decode.c b/libraries/liblber/decode.c index 94a1c6ea14..9971195c88 100644 --- a/libraries/liblber/decode.c +++ b/libraries/liblber/decode.c @@ -39,7 +39,6 @@ ber_get_tag( BerElement *ber ) { unsigned char xbyte; ber_tag_t tag; - char *tagp; unsigned int i; assert( ber != NULL ); @@ -48,16 +47,17 @@ ber_get_tag( BerElement *ber ) if ( ber_read( ber, (char *) &xbyte, 1 ) != 1 ) return( LBER_DEFAULT ); + tag = xbyte; + if ( (xbyte & LBER_BIG_TAG_MASK) != LBER_BIG_TAG_MASK ) - return( (ber_tag_t) xbyte ); + return tag; - tagp = (char *) &tag; - tagp[0] = xbyte; for ( i = 1; i < sizeof(ber_tag_t); i++ ) { if ( ber_read( ber, (char *) &xbyte, 1 ) != 1 ) return( LBER_DEFAULT ); - tagp[i] = xbyte; + tag << 8; + tag &= 0x00ffUL & (ber_tag_t) xbyte; if ( ! (xbyte & LBER_MORE_TAG_MASK) ) break; @@ -68,7 +68,7 @@ ber_get_tag( BerElement *ber ) return( LBER_DEFAULT ); /* want leading, not trailing 0's */ - return( tag >> (sizeof(ber_tag_t) - i - 1) ); + return tag; } ber_tag_t diff --git a/libraries/liblber/liblber.dsp b/libraries/liblber/liblber.dsp index 72e635daf3..29ed4fadcf 100644 --- a/libraries/liblber/liblber.dsp +++ b/libraries/liblber/liblber.dsp @@ -43,6 +43,7 @@ CPP=cl.exe # PROP Output_Dir "..\..\Release" # PROP Intermediate_Dir "..\..\Release\liblber" # PROP Target_Dir "" +RSC=rc.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "_WINDOWS" /YX /FD /c BSC32=bscmake.exe @@ -64,6 +65,7 @@ LIB32=link.exe -lib # PROP Output_Dir "..\..\Debug" # PROP Intermediate_Dir "..\..\Debug\liblber" # PROP Target_Dir "" +RSC=rc.exe # ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /c BSC32=bscmake.exe @@ -85,6 +87,7 @@ LIB32=link.exe -lib # PROP Output_Dir "..\..\Sdebug" # PROP Intermediate_Dir "..\..\SDebug\liblber" # PROP Target_Dir "" +RSC=rc.exe # ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /c # ADD CPP /nologo /W3 /GX /Z7 /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /c BSC32=bscmake.exe @@ -106,6 +109,7 @@ LIB32=link.exe -lib # PROP Output_Dir "..\..\SRelease" # PROP Intermediate_Dir "..\..\SRelease\liblber" # PROP Target_Dir "" +RSC=rc.exe # ADD BASE CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "_WINDOWS" /YX /FD /c BSC32=bscmake.exe @@ -127,6 +131,7 @@ LIB32=link.exe -lib # PROP Output_Dir "..\..\DLLDebug" # PROP Intermediate_Dir "..\..\DLLDebug\liblber" # PROP Target_Dir "" +RSC=rc.exe # ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /c # ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /c BSC32=bscmake.exe @@ -148,6 +153,7 @@ LIB32=link.exe -lib # PROP Output_Dir "liblber0" # PROP Intermediate_Dir "liblber0" # PROP Target_Dir "" +RSC=rc.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "_WINDOWS" /YX /FD /c BSC32=bscmake.exe -- 2.39.5