sqlmapproject/sqlmap · error · ValueError

truncated DNS label

Error message

truncated DNS label

What it means

Error "truncated DNS label" thrown in sqlmapproject/sqlmap.

Source

Thrown at extra/kerberos/discovery.py:125

    while True:
        if offset >= len(data):
            raise ValueError("truncated DNS name")
        length = data[offset]
        if length == 0:
            offset += 1
            break
        if length & 0xc0 == 0xc0:                          # follow compression pointer (bounded, cycle-safe)
            if offset + 2 > len(data):
                raise ValueError("truncated DNS pointer")
            jumps += 1
            if jumps > _MAX_NAME_JUMPS:
                raise ValueError("too many DNS compression jumps")
            if end is None:
                end = offset + 2
            offset = ((length & 0x3f) << 8) | data[offset + 1]
            continue
        if offset + 1 + length > len(data):
            raise ValueError("truncated DNS label")
        labels.append(bytes(data[offset + 1:offset + 1 + length]).decode("ascii", "replace"))
        offset += 1 + length
    return ".".join(labels), (end if end is not None else offset)

def parseSrv(response):
    """Parse SRV records from a (possibly hostile) DNS response into [(priority, weight, port,
    target), ...]. Malformed input yields an empty list rather than raising."""

    data = bytearray(response)
    if len(data) < 12:
        return []
    try:
        qdcount, ancount = struct.unpack(">HH", bytes(data[4:8]))
        offset = 12
        for _ in range(qdcount):
            offset = _skipName(data, offset) + 4           # + qtype/qclass
        records = []
        for _ in range(ancount):

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at extra/kerberos/discovery.py:125 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/1b635a540847ac8b. Report an issue: GitHub.