Skip to content
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

Fix integer overflow when setting maxIdleTime #1357

Merged
merged 1 commit into from Jan 27, 2015
Merged

Fix integer overflow when setting maxIdleTime #1357

merged 1 commit into from Jan 27, 2015

Conversation

vividtone
Copy link
Contributor

@vividtone vividtone commented Jan 25, 2015

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

@FooBarWidget
Copy link
Member

FooBarWidget commented Jan 26, 2015

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
Copy link
Contributor Author

vividtone commented Jan 27, 2015

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

FooBarWidget added a commit that referenced this issue Jan 27, 2015
Fix integer overflow when setting maxIdleTime
@FooBarWidget FooBarWidget merged commit 622485f into phusion:master Jan 27, 2015
1 check passed
@FooBarWidget
Copy link
Member

FooBarWidget commented Jan 27, 2015

Thank you, it has been merged now.

FooBarWidget added a commit that referenced this issue Jan 27, 2015
@vividtone
Copy link
Contributor Author

vividtone commented Jan 27, 2015

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

@FooBarWidget
Copy link
Member

FooBarWidget commented Jan 27, 2015

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

@vividtone
Copy link
Contributor Author

vividtone commented Jan 27, 2015

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants