code: public static void sanityCheck(int length, byte[] frame, int offset) throws JMFMessageCorruptionException {
      if (length < 0 || offset + 4 + length > frame.length) {
        JMFMessageCorruptionException jmce =  new JMFMessageCorruptionException(
            "Bad length: " + HexUtil.toString(new int[] { length }) + " at offset " + offset);
        FFDCFilter.processException(jmce, "com.ibm.ws.sib.mfp.jmf.impl.JSListCoder.sanityCheck", "160", Integer.valueOf(length),
            new Object[] { MfpConstants.DM_BUFFER, frame, Integer.valueOf(0), Integer.valueOf(frame.length) });
        throw jmce;
      }
    }
docs: A method to sanity check a 32 bit length value read from the message prior to allocating
  storage based on the value.  The length is not allowed to be negative or to exceed
  the length of the remaining portion of the message's frame, assuming that the length
  field is immediately followed by the data whose length it is.
  
  @param length the length value just read from the message
  @param frame the message's frame
  @param offset the offset in the frame at which the length value was read.  This is
  assumed to be four bytes long and immediately followed by the data whose length is
  supposedly given by the length parameter.
  @exception MessageCorruptionException if the sanity check fails