Program: 130285
Project: 130285
Buggy source:
/** 
 * Constructs a   {@link MapPcpResponse} object by parsing a buffer.
 * @param buffer buffer containing PCP response data
 * @throws NullPointerException if any argument is {@code null}
 * @throws BufferUnderflowException if not enough data is available in {@code buffer}
 * @throws IllegalArgumentException if there's not enough or too much data remaining in the buffer, or if the version doesn't match theexpected version (must always be  {@code 2}), or if the r-flag isn't set, or if there's an unsuccessful/unrecognized result code, or if the op code doesn't match the MAP opcode, or if the response has a   {@code 0} for its {@code internalPort} or{@code assignedExternalPort} field, or if there were problems parsing options
 * @throws IllegalArgumentException if any numeric argument is negative, or if {@code buffer} isn't the right size (max of 1100 bytes)or is malformed ( {@code r-flag != 1 || op != 1 || 0L > lifetime > 0xFFFFFFFFL || mappingNonce.length != 12 || 0 > protocol > 255|| 0 > internalPort > 65535  || (resultCode == 0 && lifetime != 0 ? 1 > assignedExternalPort > 65535 : 0 > assignedExternalPort > 65535)}) or contains an unparseable options region.
 */
public MapPcpResponse(byte[] buffer){
  super(buffer,DATA_LENGTH);
  Validate.isTrue(super.getOp() == OPCODE);
  int offset=HEADER_LENGTH;
  mappingNonce=new byte[NONCE_LENGTH];
  System.arraycopy(buffer,offset,mappingNonce,0,mappingNonce.length);
  offset+=mappingNonce.length;
  protocol=buffer[offset] & 0xFF;
  offset++;
  offset+=3;
  internalPort=InternalUtils.bytesToShort(buffer,offset);
  offset+=2;
  assignedExternalPort=InternalUtils.bytesToShort(buffer,offset);
  offset+=2;
  assignedExternalIpAddress=NetworkUtils.convertBytesToAddress(buffer,offset,16);
  offset+=16;
  validateState();
}

Fixed version (ground truth):
/** 
 * Constructs a   {@link MapPcpResponse} object by parsing a buffer.
 * @param buffer buffer containing PCP response data
 * @throws NullPointerException if any argument is {@code null}
 * @throws BufferUnderflowException if not enough data is available in {@code buffer}
 * @throws IllegalArgumentException if there's not enough or too much data remaining in the buffer, or if the version doesn't match theexpected version (must always be  {@code 2}), or if the r-flag isn't set, or if there's an unsuccessful/unrecognized result code, or if the op code doesn't match the MAP opcode, or if the response has a   {@code 0} for its {@code internalPort} or{@code assignedExternalPort} field, or if there were problems parsing options
 * @throws IllegalArgumentException if any numeric argument is negative, or if {@code buffer} isn't the right size (max of 1100 bytes)or is malformed ( {@code r-flag != 1 || op != 1 || 0L > lifetime > 0xFFFFFFFFL || mappingNonce.length != 12 || 0 > protocol > 255|| 0 > internalPort > 65535  || (resultCode == 0 && lifetime != 0 ? 1 > assignedExternalPort > 65535 : 0 > assignedExternalPort > 65535)}) or contains an unparseable options region.
 */
public MapPcpResponse(byte[] buffer){
  super(buffer,DATA_LENGTH);
  Validate.isTrue(super.getOp() == OPCODE);
  int offset=HEADER_LENGTH;
  mappingNonce=new byte[NONCE_LENGTH];
  System.arraycopy(buffer,offset,mappingNonce,0,mappingNonce.length);
  offset+=mappingNonce.length;
  protocol=buffer[offset] & 0xFF;
  offset++;
  offset+=3;
  internalPort=InternalUtils.bytesToShort(buffer,offset) & 0xFFFF;
  offset+=2;
  assignedExternalPort=InternalUtils.bytesToShort(buffer,offset) & 0xFFFF;
  offset+=2;
  assignedExternalIpAddress=NetworkUtils.convertBytesToAddress(buffer,offset,16);
  offset+=16;
  validateState();
}