Fix negative jump targets

Rene Treffer created

Change summary

src/de/measite/minidns/util/NameUtil.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Detailed changes

src/de/measite/minidns/util/NameUtil.java 🔗

@@ -70,7 +70,7 @@ public class NameUtil {
     ) {
         int c = data[offset] & 0xff;
         if ((c & 0xc0) == 0xc0) {
-            c = ((c & 0x3f) << 8) + data[offset + 1];
+            c = ((c & 0x3f) << 8) + (data[offset + 1] & 0xff);
             if (jumps.contains(c)) {
                 throw new IllegalStateException("Cyclic offsets detected.");
             }