sqlmapproject/sqlmap · error · InterfaceError

CAS response too short (wanted %d of %d bytes)

Error message

CAS response too short (wanted %d of %d bytes)

What it means

Error "CAS response too short (wanted %d of %d bytes)" thrown in sqlmapproject/sqlmap.

Source

Thrown at extra/dbwire/cubrid.py:140

        v = struct.unpack_from(">h", self._buf, self._off)[0]; self._off += 2; return v

    def int(self):
        v = struct.unpack_from(">i", self._buf, self._off)[0]; self._off += 4; return v

    def long(self):
        v = struct.unpack_from(">q", self._buf, self._off)[0]; self._off += 8; return v

    def float(self):
        v = struct.unpack_from(">f", self._buf, self._off)[0]; self._off += 4; return v

    def double(self):
        v = struct.unpack_from(">d", self._buf, self._off)[0]; self._off += 8; return v

    def raw(self, n):
        # a slice past the end returns short data *silently*, which would hand a truncated value to the
        # caller (the fixed-width readers above raise struct.error instead)
        if n < 0 or n > self.remaining():
            raise InterfaceError("CAS response too short (wanted %d of %d bytes)" % (n, self.remaining()))
        v = self._buf[self._off:self._off + n]; self._off += n; return bytes(v)

    def skip(self, n):
        self._off += n

    def nts(self, n):  # n bytes, drop one trailing NUL if present
        b = self.raw(n)
        if b and bytearray(b)[-1:] == bytearray(b"\x00"):
            b = b[:-1]
        return b

def _decode_text(raw):
    try:
        return raw.decode("utf-8")
    except UnicodeDecodeError:
        return raw  # non-UTF-8 -> keep bytes (sqlmap hex-encodes), not lossy

def _decode_value(reader, col_type, size):

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at extra/dbwire/cubrid.py:140 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/3bfc005f9c25c874. Report an issue: GitHub.