Program: 92933
Project: 92933
Buggy source:
public void extract(@NotNull final byte[] data,@NotNull final Metadata metadata){
  final IccDirectory directory=metadata.getOrCreateDirectory(IccDirectory.class);
  final BufferReader reader=new BufferReader(data);
  directory.setByteArray(IccDirectory.TAG_ICC_PROFILE_BYTES,data);
  try {
    directory.setInt(IccDirectory.TAG_ICC_PROFILE_BYTE_COUNT,reader.getInt32(IccDirectory.TAG_ICC_PROFILE_BYTE_COUNT));
    set4ByteString(directory,IccDirectory.TAG_ICC_CMM_TYPE,reader);
    setInt32(directory,IccDirectory.TAG_ICC_PROFILE_VERSION,reader);
    set4ByteString(directory,IccDirectory.TAG_ICC_PROFILE_CLASS,reader);
    set4ByteString(directory,IccDirectory.TAG_ICC_COLOR_SPACE,reader);
    set4ByteString(directory,IccDirectory.TAG_ICC_PROFILE_CONNECTION_SPACE,reader);
    setDate(directory,IccDirectory.TAG_ICC_PROFILE_DATETIME,reader);
    set4ByteString(directory,IccDirectory.TAG_ICC_SIGNATURE,reader);
    set4ByteString(directory,IccDirectory.TAG_ICC_PLATFORM,reader);
    setInt32(directory,IccDirectory.TAG_ICC_CMM_FLAGS,reader);
    set4ByteString(directory,IccDirectory.TAG_ICC_DEVICE_MAKE,reader);
    int temp=reader.getInt32(IccDirectory.TAG_ICC_DEVICE_MODEL);
    if (temp != 0) {
      if (temp <= 0x20202020)       directory.setInt(IccDirectory.TAG_ICC_DEVICE_MODEL,temp);
 else       directory.setString(IccDirectory.TAG_ICC_DEVICE_MODEL,getStringFromInt32(temp));
    }
    setInt32(directory,IccDirectory.TAG_ICC_RENDERING_INTENT,reader);
    setInt64(directory,IccDirectory.TAG_ICC_DEVICE_ATTR,reader);
    float[] xyz=new float[]{reader.getS15Fixed16(IccDirectory.TAG_ICC_XYZ_VALUES),reader.getS15Fixed16(IccDirectory.TAG_ICC_XYZ_VALUES + 4),reader.getS15Fixed16(IccDirectory.TAG_ICC_XYZ_VALUES + 8)};
    directory.setObject(IccDirectory.TAG_ICC_XYZ_VALUES,xyz);
    int tagCount=reader.getInt32(IccDirectory.TAG_ICC_TAG_COUNT);
    directory.setInt(IccDirectory.TAG_ICC_TAG_COUNT,tagCount);
    for (int i=0; i < tagCount; i++) {
      int pos=128 + 4 + i * 12;
      int tagType=reader.getInt32(pos);
      int tagPtr=reader.getInt32(pos + 4);
      int tagLen=reader.getInt32(pos + 8);
      if (tagPtr + tagLen > data.length)       throw new BufferBoundsException(data,tagPtr,tagLen);
      byte[] b=new byte[tagLen];
      System.arraycopy(data,tagPtr,b,0,tagLen);
      directory.setByteArray(tagType,b);
    }
  }
 catch (  BufferBoundsException e) {
    directory.addError(String.format("String_Node_Str",e.getClass().getSimpleName(),e.getMessage()));
  }
}

Fixed version (ground truth):
public void extract(@NotNull final byte[] data,@NotNull final Metadata metadata){
  final IccDirectory directory=metadata.getOrCreateDirectory(IccDirectory.class);
  final BufferReader reader=new BufferReader(data);
  directory.setByteArray(IccDirectory.TAG_ICC_PROFILE_BYTES,data);
  try {
    directory.setInt(IccDirectory.TAG_ICC_PROFILE_BYTE_COUNT,reader.getInt32(IccDirectory.TAG_ICC_PROFILE_BYTE_COUNT));
    set4ByteString(directory,IccDirectory.TAG_ICC_CMM_TYPE,reader);
    setInt32(directory,IccDirectory.TAG_ICC_PROFILE_VERSION,reader);
    set4ByteString(directory,IccDirectory.TAG_ICC_PROFILE_CLASS,reader);
    set4ByteString(directory,IccDirectory.TAG_ICC_COLOR_SPACE,reader);
    set4ByteString(directory,IccDirectory.TAG_ICC_PROFILE_CONNECTION_SPACE,reader);
    setDate(directory,IccDirectory.TAG_ICC_PROFILE_DATETIME,reader);
    set4ByteString(directory,IccDirectory.TAG_ICC_SIGNATURE,reader);
    set4ByteString(directory,IccDirectory.TAG_ICC_PLATFORM,reader);
    setInt32(directory,IccDirectory.TAG_ICC_CMM_FLAGS,reader);
    set4ByteString(directory,IccDirectory.TAG_ICC_DEVICE_MAKE,reader);
    int temp=reader.getInt32(IccDirectory.TAG_ICC_DEVICE_MODEL);
    if (temp != 0) {
      if (temp <= 0x20202020)       directory.setInt(IccDirectory.TAG_ICC_DEVICE_MODEL,temp);
 else       directory.setString(IccDirectory.TAG_ICC_DEVICE_MODEL,getStringFromInt32(temp));
    }
    setInt32(directory,IccDirectory.TAG_ICC_RENDERING_INTENT,reader);
    setInt64(directory,IccDirectory.TAG_ICC_DEVICE_ATTR,reader);
    float[] xyz=new float[]{reader.getS15Fixed16(IccDirectory.TAG_ICC_XYZ_VALUES),reader.getS15Fixed16(IccDirectory.TAG_ICC_XYZ_VALUES + 4),reader.getS15Fixed16(IccDirectory.TAG_ICC_XYZ_VALUES + 8)};
    directory.setObject(IccDirectory.TAG_ICC_XYZ_VALUES,xyz);
    int tagCount=reader.getInt32(IccDirectory.TAG_ICC_TAG_COUNT);
    directory.setInt(IccDirectory.TAG_ICC_TAG_COUNT,tagCount);
    for (int i=0; i < tagCount; i++) {
      int pos=128 + 4 + i * 12;
      int tagType=reader.getInt32(pos);
      int tagPtr=reader.getInt32(pos + 4);
      int tagLen=reader.getInt32(pos + 8);
      byte[] b=reader.getBytes(tagPtr,tagLen);
      directory.setByteArray(tagType,b);
    }
  }
 catch (  BufferBoundsException e) {
    directory.addError(String.format("String_Node_Str",e.getClass().getSimpleName(),e.getMessage()));
  }
}