{"record":{"id":"a5c49f3cb7e0ad77","repo":"sqlmapproject/sqlmap","slug":"frame-type-and-flags-must-fit-in-one-octet","errorCode":null,"errorMessage":"frame type and flags must fit in one octet","messagePattern":"frame type and flags must fit in one octet","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/request/http2.py","lineNumber":268,"sourceCode":"def _as_bytes(value):\n    if isinstance(value, bytes):\n        return value\n    if isinstance(value, bytearray):\n        return bytes(value)\n    if isinstance(value, text_type):\n        return value.encode(\"latin-1\")\n    raise TypeError(\"expected bytes/text value, got %s\" % type(value).__name__)\n\n\ndef encode_frame(ftype, flags, stream_id, payload=b\"\"):\n    \"\"\"Serialize an HTTP/2 frame.\n\n    >>> decode_frame_header(encode_frame(HEADERS, FLAG_END_HEADERS, 1, b'abc')[:9])\n    (3, 1, 4, 1)\n    \"\"\"\n    payload = _as_bytes(payload)\n    if not (0 <= ftype <= 0xff and 0 <= flags <= 0xff):\n        raise ValueError(\"frame type and flags must fit in one octet\")\n    if not (0 <= stream_id <= MAX_STREAM_ID):\n        raise ValueError(\"stream id must be between 0 and 2^31-1\")\n    if len(payload) > MAX_FRAME_SIZE:\n        raise ValueError(\"frame payload exceeds 24-bit length\")\n    header = struct.pack(\"!I\", len(payload))[1:]\n    header += struct.pack(\"!BBI\", ftype, flags, stream_id)\n    return header + payload\n\n\ndef decode_frame_header(nine):\n    \"\"\"Parse a 9-byte frame header into (length, type, flags, stream_id).\n\n    >>> decode_frame_header(encode_frame(DATA, 0, 1, b'')[:9])\n    (0, 0, 0, 1)\n    \"\"\"\n    if len(nine) != 9:\n        raise ValueError(\"frame header must be exactly 9 bytes\")\n    length = struct.unpack(\"!I\", b\"\\x00\" + nine[:3])[0]","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/request/http2.py#L250-L286","documentation":"Error \"frame type and flags must fit in one octet\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at lib/request/http2.py:268 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}