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
Memory allocation fixes in flatlaf-natives/flatlaf-natives-windows #591
Comments
I have created a branch at https://github.com/johnplatts/FlatLaf_Win32_Native_Fix/tree/flatlaf_win32_native_fix that includes fixes to flatlaf-natives/flatlaf-natives-windows/src/main/cpp/ to fix the issues surrounding memory allocation failures and overflow in HWNDMap::ensureCapacity. |
@johnplatts Thanks. I'll have a look at this in the next weeks. |
@johnplatts thanks for the code. I've also removed the integer overflow handling in HWNDMap because this will never occur. |
I noticed that the operator delete[] overload is missing (and should be added) to the flatlaf-natives/flatlaf-natives-windows/src/main/cpp/Runtime.cpp file as follows:
The following line in flatlaf-natives/flatlaf-natives-windows/src/main/cpp/HWNDMap.cpp needs to be changed to
delete[] table
:FlatLaf/flatlaf-natives/flatlaf-natives-windows/src/main/cpp/HWNDMap.cpp
Line 137 in 596ff33
There is also undefined behavior in FlatWndProc::install, HWNDMap::HWNDMap, and HWNDMap::ensureCapacity if memory allocation fails.
The text was updated successfully, but these errors were encountered: