Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: fix buffer overflow in data array of ldexp and frexp #4839

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
Jul 6, 2014

Conversation

juliantaylor
Copy link
Contributor

the number types does not match the size of the blank array anymore, use
a larger array and add asserts to ensure the size matches.

the number types does not match the size of the blank array anymore, use
a larger array and add asserts to ensure the size matches.
@juliantaylor
Copy link
Contributor Author

found with gcc's address sanitizer (-fsanitize=address)

@@ -227,6 +224,7 @@ static char frexp_signatures[] = {
,NPY_LONGDOUBLE, NPY_LONGDOUBLE, NPY_INT
#endif
};
static void * blank_data[12];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

static data is zero initialized

@ewmoore
Copy link
Contributor

ewmoore commented Jul 6, 2014

How about generating these ifucking like is done with the rest of them?

@juliantaylor
Copy link
Contributor Author

I guess there is probably a reason for why they are not generated but I lack the time to figure it out

juliantaylor added a commit that referenced this pull request Jul 6, 2014
BUG: fix buffer overflow in data array of ldexp and frexp
@juliantaylor juliantaylor merged commit ca397d8 into numpy:master Jul 6, 2014
@juliantaylor juliantaylor deleted the buffer-overflow branch July 6, 2014 16:49
@charris
Copy link
Member

charris commented Jul 6, 2014

@ewmoore It would be nice to generate them, but the current code generation machinery doesn't allow for the needed specifation.

@ewmoore
Copy link
Contributor

ewmoore commented Jul 7, 2014

FWIW there is a commit or two over in my stalled reworking of the complex npymath functions (#3010)that adds generating them.

Also sorry about the typo'd curse above, that was unintentional and not directed at anyone. I'm on my phone.

@charris
Copy link
Member

charris commented Jul 7, 2014

@ewmoore A PR improving the generator and moving those declarations elsewhere would be welcome.

@charris
Copy link
Member

charris commented Jul 7, 2014

@ewmoore That typo (ahem) almost motivated me to buy a Mac.

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.

4 participants