From 147a1c19c1f7bfe8d0939618d3c8dc2bb4e59fb7 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 10 Dec 2023 20:54:33 +0100 Subject: Add more property-based tests and fix more bugs. Change-Id: I8deb1a7d75078c037714541d8f6f656052c2476c --- .../src/main/java/eu/mulk/jgvariant/ostree/DeltaOperation.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'jgvariant-ostree/src/main/java/eu') diff --git a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/DeltaOperation.java b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/DeltaOperation.java index 42b7056..bb31e50 100644 --- a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/DeltaOperation.java +++ b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/DeltaOperation.java @@ -130,6 +130,7 @@ public sealed interface DeltaOperation { * @see #readVarint64 */ private static void writeVarint64(ByteArrayOutputStream output, long value) { + int n = 0; do { byte b = (byte) (value & 0x7F); value >>= 7; @@ -137,6 +138,7 @@ public sealed interface DeltaOperation { b |= (byte) 0x80; } output.write(b); - } while (value != 0); + ++n; + } while (value != 0 && n < 10); } } -- cgit v1.2.3