FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-21983: Fix a crash in ctypes.cast() in case the type argument is a ctypes structured data type. by orenmn · Pull Request #3859 · python/cpython · GitHub

/ cpython Public

bpo-21983: Fix a crash in ctypes.cast() in case the type argument is a ctypes structured data type. - #3859

Merged
zooba merged 1 commit into
python:masterfrom
orenmn:bpo21983-fix-crash
May 9, 2018
Merged

bpo-21983: Fix a crash in ctypes.cast() in case the type argument is a ctypes structured data type.#3859
zooba merged 1 commit into
python:masterfrom
orenmn:bpo21983-fix-crash

Conversation

orenmn commented Oct 2, 2017
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

In addition, add tests to test_ctypes to make sure that cast() raises a TypeError in case of a bad type argument (and doesn't crash).

https://bugs.python.org/issue21983

array = array_type()
self.assertRaises(TypeError, cast, array, None)
self.assertRaises(TypeError, cast, array, array_type)
class Struct(Structure):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I don't know if cpython does this, but linking to the bug number in the test might be nice.

eric-wieser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Fix looks obviously correct to me, and I can verify the test fails without it.

Copy link
Copy Markdown
Contributor

Thanks @orenmn for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

Copy link
Copy Markdown
Contributor

Thanks @orenmn for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖

Copy link
Copy Markdown
Contributor

Thanks @orenmn for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 9, 2018
…ed data type (pythonGH-3859)

(cherry picked from commit d518d8b)

Co-authored-by: Oren Milman <orenmn@gmail.com>

Copy link
Copy Markdown

GH-6745 is a backport of this pull request to the 3.7 branch.

Copy link
Copy Markdown
Contributor

Sorry, @orenmn and @zooba, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker d518d8bc8d5dac1a1270612f424d33e0e5afc2b5 2.7

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 9, 2018
…ed data type (pythonGH-3859)

(cherry picked from commit d518d8b)

Co-authored-by: Oren Milman <orenmn@gmail.com>

Copy link
Copy Markdown

GH-6746 is a backport of this pull request to the 3.6 branch.

Copy link
Copy Markdown
Contributor

@orenmn: Any change you could take a look at #5576, since you've already been looking over ctypes?

miss-islington added a commit that referenced this pull request May 9, 2018
…ed data type (GH-3859)

(cherry picked from commit d518d8b)

Co-authored-by: Oren Milman <orenmn@gmail.com>

orenmn commented May 10, 2018

Copy link
Copy Markdown
Contributor Author

sorry Eric, but i am too busy nowadays...

miss-islington added a commit that referenced this pull request May 26, 2018
…ed data type (GH-3859)

(cherry picked from commit d518d8b)

Co-authored-by: Oren Milman <orenmn@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL