Skip to content

Commit c8845f6

Browse files
committed
fixed a division by zero if the blocksize of the bigintger to byte array requests a length blocksize
1 parent a15ca46 commit c8845f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/de/rub/nds/modifiablevariable/util/ArrayConverter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ public static void makeArrayNonZero(final byte[] array) {
276276
* @return big integer represented in bytes, padded to a specific block size
277277
*/
278278
public static byte[] bigIntegerToByteArray(BigInteger value, int blockSize, boolean removeSignByte) {
279+
if(blockSize == 0)
280+
{
281+
return new byte[0];
282+
}
279283
byte[] array = value.toByteArray();
280284
int remainder = array.length % blockSize;
281285
byte[] result = array;

0 commit comments

Comments
 (0)