+30
-31
domain_name.go
+30
-31
domain_name.go
······+return "", len(buf), fmt.Errorf("failed to read domain compression pointer offset byte: %w", err)·········+func encodeDomain(bytes []byte, domainName string, offsets *map[string]uint16) ([]byte, error) {······
+143
-22
domain_test.go
+143
-22
domain_test.go
···························+t.Logf("Test: %s, Input: %x, OffsetIn: %d => Domain: '%s', OffsetOut: %d, Err: %v", tt.name, tt.input, tt.offset, domain, offset, err)······
+24
-10
errors.go
+24
-10
errors.go
···+return fmt.Sprintf("buffer overflow: attempted to read past buffer length %d at offset %d", e.Length, e.Offset)···
+8
-28
errors_test.go
+8
-28
errors_test.go
······+{"PositiveOffset", 10, 15, "buffer overflow: attempted to read past buffer length 10 at offset 15"},+{"ZeroLengthBuffer", 0, 5, "buffer overflow: attempted to read past buffer length 0 at offset 5"},+{"NegativeOffset", 10, -1, "buffer overflow: attempted to read past buffer length 10 at offset -1"},+{"EqualOffset", 10, 10, "buffer overflow: attempted to read past buffer length 10 at offset 10"},······
+10
-7
header.go
+10
-7
header.go
···
+81
-60
header_test.go
+81
-60
header_test.go
············+assert.True(t, errors.Is(err, tt.expectedErr), "Error type mismatch. Got %T, expected %T", err, tt.expectedErr)························+t.Errorf("FuzzDecodeHeader: expected BufferOverflowError or wrapped BOF, got %T: %v", err, err)+t.Errorf("FuzzDecodeHeader: encode/decode mismatch\nInput: %x\nEncoded: %x", data[:12], encoded)
+16
-8
question.go
+16
-8
question.go
······// Encode serializes a Question into bytes, using a map to handle domain name compression offsets.
+103
-82
question_test.go
+103
-82
question_test.go
·········+wantErrMsg: "question decode: failed to decode QName: invalid domain label: length 64 exceeds maximum 63",+wantErrMsg: "question decode: failed to decode QName: invalid domain compression: pointer loop detected",·········+assert.True(t, errors.Is(err, tt.expectedErr), "Error type mismatch. Got %T, expected %T", err, tt.expectedErr)·········-expected: []byte{9, 's', 'u', 'b', 'd', 'o', 'm', 'a', 'i', 'n', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'c', 'o', 'm', 0, 0, 28, 0, 1},+expected: []byte{9, 's', 'u', 'b', 'd', 'o', 'm', 'a', 'i', 'n', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'c', 'o', 'm', 0, 0, 28, 0, 1},······+assert.True(t, errors.Is(err, tt.expectedErr), "Error type mismatch. Got %T, expected %T", err, tt.expectedErr)···-longDomainName := string(longLabel) + "." + string(longLabel) + "." + string(longLabel) + "." + string(longLabel[:61])
+16
-16
utils.go
+16
-16
utils.go
···
+11
.golangci.toml
+11
.golangci.toml
···
+7
Justfile
+7
Justfile
+6
README.md
+6
README.md
+7
types.go
+7
types.go
·········
+7
-1
.tangled/workflows/lint.yml
+7
-1
.tangled/workflows/lint.yml
+7
-2
.tangled/workflows/test.yml
+7
-2
.tangled/workflows/test.yml
+18
.tangled/workflows/staticcheck.yml
+18
.tangled/workflows/staticcheck.yml
···