mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

boli
01.14.2009 14c8bca1f415a6a6a6cd27cec775c2d1e52427aa
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1InputStreamReader.java
@@ -765,14 +765,26 @@
      throw new ASN1Exception(message);
    }
    // If not everything was read, throw error
    // Ignore all unused trailing components.
    SizeLimitInputStream subSq = (SizeLimitInputStream)in;
    if(subSq.getSizeLimit() - subSq.getBytesRead() > 0)
    {
      Message message =
          ERR_ASN1_SEQUENCE_READ_NOT_ENDED.get(subSq.getSizeLimit() -
              subSq.getBytesRead(), subSq.getSizeLimit());
      throw new ASN1Exception(message);
      if(debugEnabled())
      {
        TRACER.debugWarning("Ignoring %d unused trailing bytes in " +
            "ASN.1 SEQUENCE", subSq.getSizeLimit() - subSq.getBytesRead());
      }
      try
      {
        subSq.skip(subSq.getSizeLimit() - subSq.getBytesRead());
      }
      catch(IOException ioe)
      {
        Message message =
            ERR_ASN1_READ_ERROR.get(ioe.toString());
        throw new ASN1Exception(message, ioe);
      }
    }
    in = streamStack.removeFirst();