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 in ns_turn_server.c #1460
base: master
Are you sure you want to change the base?
Conversation
Thank you for looking at this @Asmir . Good catch! Should we better refactor that code in this way?
It looks to me like the current approach is overcomplicated and it is what led to this kind of bug that you found. What do you think? |
This will not work because after if (!newId) check the continue statement will still cause ur_map_get to be called but with newid = 0, which is not what we want. |
ok, but can we fix that with:
I think we need to fix the current double nested iteration |
That would be a good solution. |
Can you apply it and do some basic testing if you can? Or you want me to do it? Thank you very much @Asmir |
If you don't mind applying the change since I moved to other projects and don't have my test environment. |
In case ur_map_get returns 1 server will enter infinite loop because newid != 0.