Program: 21518
Project: 21518
Buggy source:
private ResponseData readRequest() throws IOException {
  int lastSearchPos=0;
  String headers=null;
  while (true) {
    for (int i=lastSearchPos; i < inputBufferAvail - 3; ++i) {
      if (inputBuffer[i + 0] == '\r' && inputBuffer[i + 1] == '\n' && inputBuffer[i + 2] == '\r' && inputBuffer[i + 3] == '\n') {
        headers=makeString(inputBuffer,0,i);
        inputBufferPosition=i + 4;
        break;
      }
      if (inputBuffer[i + 0] == '\n' && inputBuffer[i + 1] == '\n') {
        headers=makeString(inputBuffer,0,i);
        inputBufferPosition=i + 2;
        break;
      }
    }
    if (inputBufferPosition != 0)     break;
    lastSearchPos=inputBufferAvail > 3 ? inputBufferAvail - 3 : 0;
    if (!readDataIntoBuffer())     throw new IOException("String_Node_Str" + inputBuffer.length + "String_Node_Str");
  }
  ResponseData response=new ResponseData();
  parseResponseHeaders(headers,response);
  int contentLength=-1;
  try {
    String value=response.getResponseHeader("String_Node_Str");
    if (value.length() > 0)     contentLength=Integer.parseInt(value);
  }
 catch (  NumberFormatException e) {
    throw new IOException("String_Node_Str");
  }
  if (contentLength != -1) {
    response.data=new byte[contentLength];
    readDataBlocking(response.data,contentLength,false);
  }
 else   if (response.getResponseHeader("String_Node_Str").equals("String_Node_Str")) {
    response.data=readChunkedBlocking();
  }
 else {
    response.majorVersion=1;
    response.minorVersion=0;
    response.data=readUntilEOF();
  }
  return response;
}

Fixed version (ground truth):
private ResponseData readRequest() throws IOException {
  int lastSearchPos=inputBufferPosition;
  String headers=null;
  while (true) {
    boolean found=false;
    for (int i=lastSearchPos; i < inputBufferAvail; ++i) {
      if (i + 3 < inputBufferAvail && inputBuffer[i + 0] == '\r' && inputBuffer[i + 1] == '\n' && inputBuffer[i + 2] == '\r' && inputBuffer[i + 3] == '\n') {
        headers=makeString(inputBuffer,inputBufferPosition,i - inputBufferPosition);
        inputBufferPosition=i + 4;
        found=true;
        break;
      }
      if (i + 1 < inputBufferAvail && inputBuffer[i + 0] == '\n' && inputBuffer[i + 1] == '\n') {
        headers=makeString(inputBuffer,inputBufferPosition,i - inputBufferPosition);
        inputBufferPosition=i + 2;
        found=true;
        break;
      }
    }
    if (found)     break;
    lastSearchPos=inputBufferAvail > 3 ? inputBufferAvail - 3 : 0;
    if (!readDataIntoBuffer())     throw new IOException("String_Node_Str" + inputBuffer.length + "String_Node_Str");
  }
  ResponseData response=new ResponseData();
  parseResponseHeaders(headers,response);
  int contentLength=-1;
  try {
    String value=response.getResponseHeader("String_Node_Str");
    if (value.length() > 0)     contentLength=Integer.parseInt(value);
  }
 catch (  NumberFormatException e) {
    throw new IOException("String_Node_Str");
  }
  if (contentLength != -1) {
    response.data=new byte[contentLength];
    readDataBlocking(response.data,contentLength,false);
  }
 else   if (response.getResponseHeader("String_Node_Str").equals("String_Node_Str")) {
    response.data=readChunkedBlocking();
  }
 else {
    response.majorVersion=1;
    response.minorVersion=0;
    response.data=readUntilEOF();
  }
  return response;
}