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 infinite loop due to size/unsigned mismatch. #738

Merged
merged 1 commit into from Jun 4, 2014

Conversation

@sorlok
Copy link
Contributor

commented Jun 3, 2014

So fun story. size_t is "long unsigned int" on Linux 64-bit. That meas casting it to an unsigned int can lead to an infinite loop when checking against string::npos (since the cast value will always be truncated).

This was the only instance I came across, but it causes games that use d3d_model_load() with GL1 on Linux to spin forever and thrash my system.

@JoshDreamland

This comment has been minimized.

Copy link
Member

commented Jun 4, 2014

...

You're completely correct, and I'm completely aware of how this made it past review, but I still don't have any remark on the matter. Other than, well, thanks!

JoshDreamland added a commit that referenced this pull request Jun 4, 2014
Merge pull request #738 from sorlok/fix_size_t
Fix infinite loop due to size/unsigned mismatch.

@JoshDreamland JoshDreamland merged commit 5d5d8cd into enigma-dev:master Jun 4, 2014

@RobertBColton

This comment has been minimized.

Copy link
Member

commented Jun 4, 2014

lol, Windows can run that just fine, with magic

@sorlok sorlok deleted the sorlok:fix_size_t branch Jun 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.