-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
bpo-30245: possible overflow when organize struct.pack_into error message #1682
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
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
@johanliu, thanks for your PR! By analyzing the history of the files in this pull request, we identified @mdickinson, @serhiy-storchaka and @Yhg1s to be potential reviewers. |
Modules/_struct.c
Outdated
@@ -1929,11 +1929,15 @@ s_pack_into(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames | |||
|
|||
/* Check boundaries */ | |||
if ((buffer.len - offset) < soself->s_size) { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove these empty lines. They look distracting.
Lib/test/test_struct.py
Outdated
regex = ( | ||
"pack_into requires a buffer of at least " + str(sys.maxsize + 4) + | ||
" bytes for packing 4 bytes at offset " + str(sys.maxsize) + | ||
" \(actual buffer size is 10\)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use raw string literals. Compiling "\("
emits a deprecation warning.
You also could use classic string formatting, string's format() method, or f-string expression for composing this string.
Misc/ACKS
Outdated
@@ -1746,3 +1746,4 @@ evilzero | |||
Dhushyanth Ramasamy | |||
Subhendu Ghosh | |||
Sanjay Sundaresan | |||
Yuan Liu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Names are sorted in roughly alphabetical order. Thus your name should be about letter L or Y (don't know what of names is a surname).
@johanliu Your PR looks good. Have you signed the CLA? We can't accept the PR until it is signed. |
Hi, I have already signed the CLA but seems like the procedure not finished yet. It takes one week after I submit the application. What should I do right now on this issue? Thank you.
2017年5月27日 +0800 22:30 Mariatta <[email protected]>,写道:
@johanliu<https://github.com/johanliu> Your PR looks good. Have you signed the CLA? We can't accept the PR until it is signed.
Thank you.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1682 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAzzSNWDfVWbkRL2gLgw1BvBtNyMJ8XZks5r-DOagaJpZM4NhU-t>.
|
Thanks @johanliu Looks like your CLA form has been received. |
I just try to extend the huge sum from signed long to unsigned long in order to print it without showing overflowed effect.
I suppose it works as expected since you can't make a buffer which size is larger than sys.maxsize. so as before, it make sense.