Skip to content

Address boundary error #6

@WeirdCarrotMonster

Description

@WeirdCarrotMonster

Python 3.5.2, multidict-2.0.0 from PyPI, following code fails with SIGSEGV:

from multidict import MultiDict
set() - MultiDict().keys()

If i understood correctly, error happens in PyAnySet_Check call, since set substraction is basically difference method call with type check:

if (!PyAnySet_Check(so) || !PyAnySet_Check(other)) {
    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}
return set_difference(so, other);

It also can be reproduced with dict and list objects, so i think problem may be related to type checking.

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