sqlmapproject/sqlmap · error · InterfaceError

length-encoded string overruns packet

Error message

length-encoded string overruns packet

What it means

Error "length-encoded string overruns packet" thrown in sqlmapproject/sqlmap.

Source

Thrown at extra/dbwire/mysql.py:112

def _lenc_int(data, off):
    first = _u8(data, off)
    if first < 0xfb:
        return first, off + 1
    elif first == 0xfb:
        return None, off + 1  # NULL (in a row)
    elif first == 0xfc:
        return struct.unpack("<H", data[off + 1:off + 3])[0], off + 3
    elif first == 0xfd:
        return struct.unpack("<I", data[off + 1:off + 4] + b"\x00")[0], off + 4
    else:  # 0xfe
        return struct.unpack("<Q", data[off + 1:off + 9])[0], off + 9

def _lenc_str(data, off):
    length, off = _lenc_int(data, off)
    if length is None:
        return None, off
    if off + length > len(data):
        raise InterfaceError("length-encoded string overruns packet")
    return data[off:off + length], off + length

def _err_message(payload):
    # ERR packet: 0xff, Int2 code, (if PROTOCOL_41) '#' + 5-byte SQLSTATE, then message
    off = 3
    if payload[3:4] == b"#":
        off = 9
    return payload[off:].decode("utf-8", "replace")

def _bit_int(value):
    n = 0  # BIT arrives as a big-endian byte string
    for b in bytearray(value):
        n = (n << 8) | b
    return n

def _scramble_native(password, salt):
    if not password:
        return b""

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at extra/dbwire/mysql.py:112 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/a98c727850dfc66c. Report an issue: GitHub.