Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix Gecko codes loading #8542
While searching where this behavior could come from, I stumbled upon this :
So ... I am very lost about the true origin of this bug ...
Okay, apparently certain locales allow spaces within a single formatted number.
Both GeckoCode values are read as a single 64 bit hex value which overflows causing the issue.
This is horrible. We probably assume formatted number input does not cross white space throughout dolphin.
Some locales (e.g. fr_FR.UTF-8 on ArchLinux) don't split the string stream on a space. As such, when extracted formatted data from te stream, it will return the two numbers as one for the first call, effectively overflowing the u32 variable, then will do an out-of-bounds read for the second call. Forcing the use of the C locale on the streams where it would cause a problem allows to workaround this behavior.