Program: 54268
Project: 54268
Buggy source:
public void run(){
  int read=-1, size=0, max=0;
  byte[] chunk=new byte[CHUNK_SIZE];
  try {
    max=Integer.parseInt(System.getSettings().getString("String_Node_Str","String_Node_Str"));
  }
 catch (  NumberFormatException e) {
    max=10485760;
  }
  try {
    String location=null, contentType=null;
    while ((read=mReader.read(chunk,0,CHUNK_SIZE)) > 0 && size < max) {
      mBuffer.append(chunk,read);
      size+=read;
      location=location == null ? RequestParser.getHeaderValue("String_Node_Str",mBuffer) : location;
      contentType=contentType == null ? RequestParser.getHeaderValue("String_Node_Str",mBuffer) : contentType;
      if (contentType != null) {
        boolean isHandledContentType=false;
        for (        String handled : FILTERED_CONTENT_TYPES) {
          if (contentType.equals(handled) || contentType.contains(handled)) {
            isHandledContentType=true;
            break;
          }
        }
        if (isHandledContentType == false) {
          Log.d(TAG,"String_Node_Str" + contentType + "String_Node_Str");
          mWriter.write(mBuffer.getData());
          mWriter.flush();
          while ((read=mReader.read(chunk,0,512)) > 0) {
            mWriter.write(chunk,0,read);
          }
          mWriter.flush();
          mWriter.close();
          mReader.close();
          return;
        }
      }
    }
    if (mBuffer.isEmpty() == false) {
      String data=mBuffer.toString();
      String[] split=data.split(HEAD_SEPARATOR,2);
      String headers=split[0];
      if (location != null && location.startsWith("String_Node_Str") && System.getSettings().getBoolean("String_Node_Str",true) == true) {
        Log.w(TAG,"String_Node_Str" + location);
        mBuffer.replace("String_Node_Str".getBytes(),"String_Node_Str".getBytes());
        data=mBuffer.toString();
        split=data.split(HEAD_SEPARATOR,2);
        headers=split[0];
        HTTPSMonitor.getInstance().addURL(mClient,location.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str"));
      }
      String body=(split.length > 1 ? split[1] : "String_Node_Str"), patched="String_Node_Str";
      body=mFilter.onDataReceived(headers,body);
      for (      String header : headers.split("String_Node_Str")) {
        if (header.toLowerCase().contains("String_Node_Str") == false)         patched+=header + "String_Node_Str";
      }
      headers=patched;
      mBuffer.setData((headers + HEAD_SEPARATOR + body).getBytes());
      mWriter.write(mBuffer.getData());
      mWriter.flush();
    }
  }
 catch (  OutOfMemoryError ome) {
    Log.e(TAG,ome.toString());
  }
catch (  Exception e) {
    System.errorLogging(TAG,e);
  }
 finally {
    try {
      mWriter.flush();
      mWriter.close();
      mReader.close();
    }
 catch (    IOException e) {
    }
  }
}

Fixed version (ground truth):
public void run(){
  int read=-1, size=0, max=0;
  byte[] chunk=new byte[CHUNK_SIZE];
  try {
    max=Integer.parseInt(System.getSettings().getString("String_Node_Str","String_Node_Str"));
  }
 catch (  NumberFormatException e) {
    max=10485760;
  }
  try {
    String location=null, contentType=null;
    while ((read=mReader.read(chunk,0,CHUNK_SIZE)) > 0 && size < max) {
      mBuffer.append(chunk,read);
      size+=read;
      location=location == null ? RequestParser.getHeaderValue("String_Node_Str",mBuffer) : location;
      contentType=contentType == null ? RequestParser.getHeaderValue("String_Node_Str",mBuffer) : contentType;
      if (contentType != null) {
        boolean isHandledContentType=false;
        for (        String handled : FILTERED_CONTENT_TYPES) {
          if (contentType.contains(handled)) {
            isHandledContentType=true;
            break;
          }
        }
        if (isHandledContentType == false) {
          Log.d(TAG,"String_Node_Str" + contentType + "String_Node_Str");
          mWriter.write(mBuffer.getData());
          mWriter.flush();
          while ((read=mReader.read(chunk,0,CHUNK_SIZE)) > 0) {
            mWriter.write(chunk,0,read);
            mWriter.flush();
          }
          mWriter.close();
          mReader.close();
          return;
        }
      }
    }
    if (mBuffer.isEmpty() == false) {
      String data=mBuffer.toString();
      String[] split=data.split(HEAD_SEPARATOR,2);
      String headers=split[0];
      if (location != null && location.startsWith("String_Node_Str") && System.getSettings().getBoolean("String_Node_Str",true) == true) {
        Log.w(TAG,"String_Node_Str" + location);
        mBuffer.replace("String_Node_Str".getBytes(),"String_Node_Str".getBytes());
        data=mBuffer.toString();
        split=data.split(HEAD_SEPARATOR,2);
        headers=split[0];
        HTTPSMonitor.getInstance().addURL(mClient,location.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str"));
      }
      String body=(split.length > 1 ? split[1] : "String_Node_Str"), patched="String_Node_Str";
      body=mFilter.onDataReceived(headers,body);
      for (      String header : headers.split("String_Node_Str")) {
        if (header.toLowerCase().contains("String_Node_Str") == false)         patched+=header + "String_Node_Str";
      }
      headers=patched;
      mBuffer.setData((headers + HEAD_SEPARATOR + body).getBytes());
      mWriter.write(mBuffer.getData());
      mWriter.flush();
    }
  }
 catch (  OutOfMemoryError ome) {
    Log.e(TAG,ome.toString());
  }
catch (  Exception e) {
    System.errorLogging(TAG,e);
  }
 finally {
    try {
      mWriter.flush();
      mWriter.close();
      mReader.close();
    }
 catch (    IOException e) {
    }
  }
}