Fix integer overflow when setting maxIdleTime #1357

Merged
merged 1 commit into from Jan 27, 2015

Projects

None yet

2 participants

@vividtone
Contributor

PassengerPoolIdleTime cannot be set greater than 4294 ((2 ** 32 - 1) / 1000000) because of integer overflow.

@FooBarWidget
Member

Thank you for catching this bug. Can I ask you to sign our contributor agreement? We need this before we can merge any patches.

@vividtone
Contributor

Thanks for reviewing the patch.
I have sent a scan of the signed contributor agreement by e-mail.

@FooBarWidget FooBarWidget merged commit 622485f into phusion:master Jan 27, 2015

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@FooBarWidget
Member

Thank you, it has been merged now.

@FooBarWidget FooBarWidget added a commit that referenced this pull request Jan 27, 2015
@FooBarWidget FooBarWidget Give credit to Maeda Go.
See GH-1357.

[ci:skip]
99b77fc
@vividtone
Contributor

I am happy to see the patch merged. Thank you.
Could it be backported to stable-4.0?

@FooBarWidget
Member

I don't think 4.x suffers from this problem. Besides, 5.0 final is slated for next month.

@vividtone
Contributor

I will wait 5.0 but Passenger 4.x have the same problem. I found the problem in 4.0.56 at first.

Please see the following. Both options.poolIdleTime and 1000000 are 32 bit width(unsigned int). So the result of the expression cannot be greater than 2**32 - 1.

https://github.com/phusion/passenger/blob/stable-4.0/ext/common/agents/HelperAgent/Main.cpp#L472

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