Skip to content

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Apr 12, 2017

@mention-bot
Copy link

@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @tiran, @cf-natali and @akuchling to be potential reviewers.

if (nchanges < 0) {
goto error;
}
nchanges = PySequence_Fast_GET_SIZE(arg);
Copy link
Member

Choose a reason for hiding this comment

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

PySequence_Fast_GET_SIZE returns a Py_ssize_t. This may trigger a compile warning.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point!

}
nchanges = PyObject_Size(ch);
if (nchanges < 0) {
if (PySequence_Fast_GET_SIZE(arg) > INT_MAX / sizeof(struct kevent)) {
Copy link
Member

@zhangyangyu zhangyangyu Apr 13, 2017

Choose a reason for hiding this comment

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

arg should be seq, right?

I don't think we need to / sizeof(struct kevent). > INT_MAX is enough. Then there will be a memory error below. Or use PY_SSIZE_T_MAX here, assuming PY_SSIZE_T_MAX / sizeof(struct kevent) <= INT_MAX.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

@zhangyangyu zhangyangyu left a comment

Choose a reason for hiding this comment

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

LGTM from code. But I can't even compile.

Copy link
Contributor

@louisom louisom left a comment

Choose a reason for hiding this comment

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

just a nit typo

kq.close()

def test_issue30058(self):
# chagelist must be an iterable
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: chagelist -> changelist

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch @lulouie!

@louisom
Copy link
Contributor

louisom commented Apr 16, 2017

@zhangyangyu why can't you compile? My env compile it well.

@zhangyangyu
Copy link
Member

@lulouie , the code is specialized for BSD. I only have access to Linux. Compiling it on Linux doesn't make any sense.

@louisom
Copy link
Contributor

louisom commented Apr 16, 2017

@zhangyangyu ah, It has compiled on Linux, but only the GNU part, not BSD part.

@vstinner vstinner self-requested a review April 21, 2017 22:54
@serhiy-storchaka serhiy-storchaka merged commit de07210 into python:master Oct 12, 2017
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@serhiy-storchaka serhiy-storchaka deleted the kqueue-control-buffer-overflow branch October 12, 2017 19:17
@bedevere-bot
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 12, 2017
@miss-islington
Copy link
Contributor

Sorry, @serhiy-storchaka, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker de072100775cc29e6cd93a75466cecbd1086f258 2.7

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Oct 12, 2017
@bedevere-bot
Copy link

GH-3976 is a backport of this pull request to the 2.7 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

9 participants