boostorg / interprocess

Boost.org interprocess module
http://boost.org/libs/interprocess
132 stars 117 forks source link

missing/misused m_is_wide in char_wchar_holder assignment operators #199

Open nobuddhy opened 1 year ago

nobuddhy commented 1 year ago

m_is_wide is not set in these both operators so if wideness has changed it might lead to call wrong delete[] later

https://github.com/boostorg/interprocess/blob/a0c5a8ff176434c9024d4540ce092a2eebb8c5c3/include/boost/interprocess/detail/char_wchar_holder.hpp#L54-L61

https://github.com/boostorg/interprocess/blob/a0c5a8ff176434c9024d4540ce092a2eebb8c5c3/include/boost/interprocess/detail/char_wchar_holder.hpp#L63-L70

if condition should be opposite currently it always assigns null string

https://github.com/boostorg/interprocess/blob/a0c5a8ff176434c9024d4540ce092a2eebb8c5c3/include/boost/interprocess/detail/char_wchar_holder.hpp#L72-L79

https://github.com/boostorg/interprocess/blob/a0c5a8ff176434c9024d4540ce092a2eebb8c5c3/include/boost/interprocess/detail/char_wchar_holder.hpp#L86-L90