Program: 52449
Project: 52449
Buggy source:
/** 
 * @exception InvalidCipherTextException if the decrypted block turns out tobe badly formatted.
 */
public byte[] decodeBlock(byte[] in,int inOff,int inLen) throws InvalidCipherTextException {
  byte[] data=engine.processBlock(in,inOff,inLen);
  byte[] block;
  if (data.length < engine.getOutputBlockSize()) {
    block=new byte[engine.getOutputBlockSize()];
    System.arraycopy(data,0,block,block.length - data.length,data.length);
  }
 else {
    block=data;
  }
  if (block.length < (2 * defHash.length) + 1) {
    throw new InvalidCipherTextException("String_Node_Str");
  }
  byte[] mask=maskGeneratorFunction1(block,defHash.length,block.length - defHash.length,defHash.length);
  for (int i=0; i != defHash.length; i++) {
    block[i]^=mask[i];
  }
  mask=maskGeneratorFunction1(block,0,defHash.length,block.length - defHash.length);
  for (int i=defHash.length; i != block.length; i++) {
    block[i]^=mask[i - defHash.length];
  }
  boolean defHashWrong=false;
  for (int i=0; i != defHash.length; i++) {
    if (defHash[i] != block[defHash.length + i]) {
      defHashWrong=true;
    }
  }
  if (defHashWrong) {
    throw new InvalidCipherTextException("String_Node_Str");
  }
  int start;
  for (start=2 * defHash.length; start != block.length; start++) {
    if (block[start] != 0) {
      break;
    }
  }
  if (start >= (block.length - 1) || block[start] != 1) {
    throw new InvalidCipherTextException("String_Node_Str" + start);
  }
  start++;
  byte[] output=new byte[block.length - start];
  System.arraycopy(block,start,output,0,output.length);
  return output;
}

Fixed version (ground truth):
/** 
 * @exception InvalidCipherTextException if the decrypted block turns out tobe badly formatted.
 */
public byte[] decodeBlock(byte[] in,int inOff,int inLen) throws InvalidCipherTextException {
  byte[] data=engine.processBlock(in,inOff,inLen);
  byte[] block;
  if (data.length < engine.getOutputBlockSize()) {
    block=new byte[engine.getOutputBlockSize()];
    System.arraycopy(data,0,block,block.length - data.length,data.length);
  }
 else {
    block=data;
  }
  if (block.length < (2 * defHash.length) + 1) {
    throw new InvalidCipherTextException("String_Node_Str");
  }
  byte[] mask=maskGeneratorFunction1(block,defHash.length,block.length - defHash.length,defHash.length);
  for (int i=0; i != defHash.length; i++) {
    block[i]^=mask[i];
  }
  mask=maskGeneratorFunction1(block,0,defHash.length,block.length - defHash.length);
  for (int i=defHash.length; i != block.length; i++) {
    block[i]^=mask[i - defHash.length];
  }
  boolean defHashWrong=false;
  for (int i=0; i != defHash.length; i++) {
    if (defHash[i] != block[defHash.length + i]) {
      defHashWrong=true;
    }
  }
  if (defHashWrong) {
    throw new InvalidCipherTextException("String_Node_Str");
  }
  int start;
  for (start=2 * defHash.length; start != block.length; start++) {
    if (block[start] != 0) {
      break;
    }
  }
  if (start > (block.length - 1) || block[start] != 1) {
    throw new InvalidCipherTextException("String_Node_Str" + start);
  }
  start++;
  byte[] output=new byte[block.length - start];
  System.arraycopy(block,start,output,0,output.length);
  return output;
}