Skip to content

Reads returns a result with an exception set, leading to a SystemError #206

@gabe-sherman

Description

@gabe-sherman

The below code raises a SystemError when provided with the following input. This indicates unexpected behavior, as the function returns with an error set, yet the return value is not NULL.

import hiredis
import sys

data = open(sys.argv[1], "rb").read().decode("utf-8")
r = hiredis.Reader()
r.feed(data)
r.gets()

Environment Info

Commit: 5b34a0e

POC File:

https://github.com/FuturesLab/POC/blob/main/hiredis-py/poc-02

To reproduce

python3 <filename>.py poc-02

Stack Trace

TypeError: unhashable type: 'dict'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "rep.py", line 7, in <module>
    r.gets()
SystemError: <class 'hiredis.ProtocolError'> returned a result with an exception set

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions