Uploaded image for project: 'James Mime4j'
  1. James Mime4j
  2. MIME4J-257

MboxIterator can append NULL bytes to message body

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.8.0
    • None
    • parser (core)
    • None

    Description

      The CharBufferWrapper doesn't return the correct value from read(). The code looks like this:

              public int read(byte[] bytes, int off, int len) throws IOException {
                  if (!buf.hasRemaining()) {
                      return -1;
                  }
                  buf.get(bytes, off, Math.min(len, buf.remaining()));
                  return len;
              }
      

      The problem is that returning len may be incorrect if buf.remaining() < len.

      Thank you.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jbalint@gmail.com Jess Balint
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: