Program: 174169
Project: 174169
Buggy source:
private void processBuf() throws IOException {
  int readBytes=0;
  if (state == State.START || state == State.HEADERS) {
    AutumnByteArrayReader reader=new AutumnByteArrayReader(buf,0,bufLimit);
    String line;
    while ((line=reader.nextLine()) != null) {
      readBytes+=line.getBytes().length + 2;
      if (state == State.START) {
        if (checkStart(line)) {
          lastActive=System.currentTimeMillis();
          state=State.HEADERS;
          headersMap.clear();
        }
      }
 else       if (state == State.HEADERS) {
        if (line.isEmpty()) {
          if (contentLength < 0) {
            lastActive=System.currentTimeMillis();
            finish();
            state=State.START;
          }
 else {
            state=State.BODY;
          }
          break;
        }
 else {
          String[] kv=line.split("String_Node_Str",2);
          if (kv.length == 2) {
            lastActive=System.currentTimeMillis();
            String key=kv[0].trim().toLowerCase();
            String value=kv[1].trim();
            headersMap.computeIfAbsent(key,k -> new ArrayList<>()).add(value);
            if (key.equals("String_Node_Str")) {
              contentLength=Integer.valueOf(value);
              if (contentLength > MAX_BODY_LENGTH) {
                error();
                state=State.START;
              }
 else {
                body=new byte[contentLength];
                bodyLimit=0;
              }
            }
          }
 else {
            error();
            state=State.START;
          }
        }
      }
    }
  }
  if (state == State.BODY) {
    lastActive=System.currentTimeMillis();
    int canRead=bufLimit - readBytes;
    if (canRead >= contentLength - bodyLimit) {
      canRead=contentLength - bodyLimit;
    }
    System.arraycopy(buf,readBytes,body,bodyLimit,canRead);
    readBytes+=canRead;
    bodyLimit+=canRead;
    if (bodyLimit >= contentLength) {
      readBytes=bufLimit;
      finish();
      state=State.START;
    }
  }
  if (readBytes < bufLimit) {
    System.arraycopy(buf,readBytes,buf,0,bufLimit - readBytes);
  }
  bufLimit-=readBytes;
}

Fixed version (ground truth):
private void processBuf() throws IOException {
  int readBytes=0;
  if (state == State.START || state == State.HEADERS) {
    AutumnByteArrayReader reader=new AutumnByteArrayReader(buf,0,bufLimit);
    String line;
    while ((line=reader.nextLine()) != null) {
      if (state == State.START) {
        if (checkStart(line)) {
          lastActive=System.currentTimeMillis();
          state=State.HEADERS;
          headersMap.clear();
        }
      }
 else       if (state == State.HEADERS) {
        if (line.isEmpty()) {
          if (contentLength < 0) {
            lastActive=System.currentTimeMillis();
            finish();
            state=State.START;
          }
 else {
            state=State.BODY;
          }
          break;
        }
 else {
          String[] kv=line.split("String_Node_Str",2);
          if (kv.length == 2) {
            lastActive=System.currentTimeMillis();
            String key=kv[0].trim().toLowerCase();
            String value=kv[1].trim();
            headersMap.computeIfAbsent(key,k -> new ArrayList<>()).add(value);
            if (key.equals("String_Node_Str")) {
              contentLength=Integer.valueOf(value);
              if (contentLength > MAX_BODY_LENGTH) {
                error();
                state=State.START;
              }
 else {
                body=new byte[contentLength];
                bodyLimit=0;
              }
            }
          }
 else {
            error();
            state=State.START;
          }
        }
      }
    }
    readBytes+=reader.getReadBytes();
  }
  if (state == State.BODY) {
    lastActive=System.currentTimeMillis();
    int canRead=bufLimit - readBytes;
    if (canRead >= contentLength - bodyLimit) {
      canRead=contentLength - bodyLimit;
    }
    System.arraycopy(buf,readBytes,body,bodyLimit,canRead);
    readBytes+=canRead;
    bodyLimit+=canRead;
    if (bodyLimit >= contentLength) {
      readBytes=bufLimit;
      finish();
      state=State.START;
    }
  }
  if (readBytes < bufLimit && readBytes > 0) {
    System.arraycopy(buf,readBytes,buf,0,bufLimit - readBytes);
  }
  bufLimit-=readBytes;
}