Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-72

Hash function leads to segfault when passed an invalid object

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 1.2.x
    • Shiboken
    • None

    Description

      The new hash function doesn't check to see if the provided object is valid before calculating the hash value. This can be seen in shiboken/libshiboken/basewrapper.cpp at line 754 and demonstrated using the following code:

      >>> from PySide import QtCore
      >>> import shiboken
      >>> a = QtCore.QObject()
      >>> b = QtCore.QObject(a)
      >>> shiboken.isValid(a)
      True
      >>> shiboken.isValid(b)
      True
      >>> del a
      >>> shiboken.isValid(b)
      False
      >>> hash(b)
      Segmentation Fault

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            setanta Marcelo Lira
            njsmith Nathan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes