Severity
Critical (crash, data loss)
Describe the bug
Location: src/InfiniFrame.Native/Platform/Windows/Dialog.cpp:231-246, src/InfiniFrame.Native/Exports.cpp:653-656.
GetResults allocates new wchar_t*[count] but only initializes entries when GetItemAt and GetDisplayName(SIGDN_FILESYSPATH) both succeed. Failed entries remain uninitialized. InfiniFrame_FreeStringArray later frees all count entries unconditionally, including uninitialized pointers.
Steps to reproduce
- Use
ShowOpenFile/ShowOpenFolder and select at least one item where SIGDN_FILESYSPATH fails.
- Receive result array/count from native code.
- Call
InfiniFrame_FreeStringArray(values, count).
Expected behavior
Each returned entry is valid or null; freeing array is always safe.
Actual behavior
Uninitialized entries are freed, causing invalid memory access/free.
Logs / Error Output
Dialog.cpp: result[i] only assigned inside SUCCEEDED(GetDisplayName)
Exports.cpp: FreeStringArray frees every values[i] for i < count
Minimal reproduction
int count = 0;
AutoString* values = InfiniFrame_ShowOpenFile(..., &count);
InfiniFrame_FreeStringArray(values, count); // may free garbage pointers
.NET Version
No response
Project Version / Commit
No response
Operating System
No response
Checklist
Severity
Critical (crash, data loss)
Describe the bug
Location:
src/InfiniFrame.Native/Platform/Windows/Dialog.cpp:231-246,src/InfiniFrame.Native/Exports.cpp:653-656.GetResultsallocatesnew wchar_t*[count]but only initializes entries whenGetItemAtandGetDisplayName(SIGDN_FILESYSPATH)both succeed. Failed entries remain uninitialized.InfiniFrame_FreeStringArraylater frees allcountentries unconditionally, including uninitialized pointers.Steps to reproduce
ShowOpenFile/ShowOpenFolderand select at least one item whereSIGDN_FILESYSPATHfails.InfiniFrame_FreeStringArray(values, count).Expected behavior
Each returned entry is valid or null; freeing array is always safe.
Actual behavior
Uninitialized entries are freed, causing invalid memory access/free.
Logs / Error Output
Minimal reproduction
.NET Version
No response
Project Version / Commit
No response
Operating System
No response
Checklist