BR: SystemStats::getUniqueDeviceID crashes on Windows

SystemStats::getUniqueDeviceID crashes on Windows.

                while (tableLen < content.size())
                    const auto* str = stringTable + tableLen;
                    const auto n = strlen (str);

                    if (n == 0)

                    strings.push_back (str);
                    tableLen += n + 1;

Here I do not you think you can assume the BIOS data is welformed, so strlen goes off the end and crashes. I think you should use strnlen instead.

>	[Inline Frame] Waveform 12 (64-bit).exe!juce::SystemStats::getUniqueDeviceID::__l7::<lambda_1>::operator()() Line 745	C++
 	Waveform 12 (64-bit).exe!juce::SystemStats::getUniqueDeviceID() Line 738	C++
 	[Inline Frame] Waveform 12 (64-bit).exe!tracktion_utilities::UUIDHelpers::getCachedJUCEUniqueDeviceID() Line 417	C++
 	Waveform 12 (64-bit).exe!tracktion_utilities::getLocalMachineIDs(tracktion_utilities::MachineIDType type) Line 429	C++
 	Waveform 12 (64-bit).exe!UnlockerHelpers::getLocalMachineIDs() Line 326	C++
 	[Inline Frame] Waveform 12 (64-bit).exe!getMachineIDs() Line 869	C++
 	Waveform 12 (64-bit).exe!isMachineNumberValid(const juce::String & machineNums) Line 41	C++
 	Waveform 12 (64-bit).exe!isFullOrDemoVersion() Line 1198	C++
 	Waveform 12 (64-bit).exe!Unlocker::checkForLocalKeyFiles() Line 756	C++
 	Waveform 12 (64-bit).exe!TracktionApp::initialise(const juce::String & commandLine) Line 811	C++
 	Waveform 12 (64-bit).exe!juce::JUCEApplicationBase::initialiseApp() Line 300	C++
 	Waveform 12 (64-bit).exe!juce::JUCEApplication::initialiseApp() Line 88	C++
 	Waveform 12 (64-bit).exe!juce::JUCEApplicationBase::main() Line 259	C++

1 Like

had reported crashs as well, but not on my computer so hard to debug :confused:

I’ve tested this function with a fuzzer to try to find potential causes of crashes. The version now on develop should be a bit more robust:


ah yeah cool :slight_smile: thx a lot!

Latest dev version fixed all my previous issues personnally. gg :slight_smile: