Skip to content

[2.7] bpo-34457: Python/ast.c: Add missing NULL check to alias_for_im… #8858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2018

Conversation

izbyshev
Copy link
Contributor

@izbyshev izbyshev commented Aug 22, 2018

…port_name(). (GH-8852)

Reported by Svace static analyzer..
(cherry picked from commit 28853a2)

Co-authored-by: Alexey Izbyshev [email protected]

https://bugs.python.org/issue34457

…port_name(). (pythonGH-8852)

Reported by Svace static analyzer..
(cherry picked from commit 28853a2)

Co-authored-by: Alexey Izbyshev <[email protected]>
@@ -2520,6 +2520,8 @@ alias_for_import_name(struct compiling *c, const node *n, int store)
break;
case STAR:
str = PyString_InternFromString("*");
if (!str)
Copy link
Contributor

Choose a reason for hiding this comment

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

In which case the if sentence could fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In an unlikely case of one-character-string cache miss combined with memory allocation failure.

@serhiy-storchaka serhiy-storchaka merged commit 5223ce2 into python:2.7 Aug 22, 2018
@izbyshev izbyshev deleted the backport-28853a2-2.7 branch August 22, 2018 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants