Loading src/main/java/org/torproject/descriptor/impl/DescriptorImpl.java +7 −2 Original line number Diff line number Diff line Loading @@ -83,7 +83,8 @@ public abstract class DescriptorImpl implements Descriptor { * * @param offset The index of the first byte to include. * @param length The number of bytes to include. * @return Copy of the given raw descriptor bytes. * @return Copy of the given raw descriptor bytes or null in case of running * out of memory. */ protected byte[] getRawDescriptorBytes(int offset, int length) { if (offset < this.offset || offset + length > this.offset + this.length Loading @@ -93,7 +94,11 @@ public abstract class DescriptorImpl implements Descriptor { + this.length); } byte[] result = new byte[length]; try { System.arraycopy(this.rawDescriptorBytes, offset, result, 0, length); } catch (OutOfMemoryError err) { return null; } return result; } Loading Loading
src/main/java/org/torproject/descriptor/impl/DescriptorImpl.java +7 −2 Original line number Diff line number Diff line Loading @@ -83,7 +83,8 @@ public abstract class DescriptorImpl implements Descriptor { * * @param offset The index of the first byte to include. * @param length The number of bytes to include. * @return Copy of the given raw descriptor bytes. * @return Copy of the given raw descriptor bytes or null in case of running * out of memory. */ protected byte[] getRawDescriptorBytes(int offset, int length) { if (offset < this.offset || offset + length > this.offset + this.length Loading @@ -93,7 +94,11 @@ public abstract class DescriptorImpl implements Descriptor { + this.length); } byte[] result = new byte[length]; try { System.arraycopy(this.rawDescriptorBytes, offset, result, 0, length); } catch (OutOfMemoryError err) { return null; } return result; } Loading