-
-
Notifications
You must be signed in to change notification settings - Fork 23.8k
Fix Windows OS.get_unique_id() null termination issue
#106052
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 Windows OS.get_unique_id() null termination issue
#106052
Conversation
OS.get_unique_id() null termination issue
21f05d2 to
eab57c5
Compare
|
Just following up @AThousandShips I think we are good here right? OP of the initial report suggested the issue was resolved with this PR as well. :) Let me know if I can assist further. 👍 |
|
I think it looks alright, but I'm not experienced on the Windows side so this needs a review by that team |
bruvzg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows docs use:
_tprintf(TEXT("Profile Guid = %s\n"), HwProfInfo.szHwProfileGuid);
as a usage example, so a null terminated string seems to be expected.
But to be 100% safe, we can check both null termination and buffer size:
return String::ascii(Span<char>(HwProfInfo.szHwProfileGuid, strnlen(HwProfInfo.szHwProfileGuid, HW_PROFILE_GUIDLEN)));|
Could you squash the commits? See PR workflow for instructions. |
8994c87 to
3e3e631
Compare
akien-mga
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the delay - I had a couple review comments queued which I forgot to submit.
use ascii for encoding-neutral check buffer size as well
d675e10 to
d79258c
Compare
|
Thanks! |
Fixes: #106012
It appears the function return from the windows API included a null termination?
I've commented this specific segment of code with a safety to handle this.
There was quite a bit of changes between 4.4 and 4.5-Dev around print() and print_rich() that created some difficulty in hunting the exact cause of the editor output hang while the console exe continued to function
This fix addresses the length, output and concat, issues.
Before:

After:
