Source-Python-Dev-Team / Source.Python

This plugin aims to use boost::python and create an easily accessible wrapper around the Source Engine API for scripter use.
http://forums.sourcepython.com
GNU General Public License v3.0
164 stars 32 forks source link

Fix ownership issue for string_pointer and buffer overrun issue for string_array. (#472) #474

Open CookStar opened 1 year ago

CookStar commented 1 year ago

This fixes the issue(#472) of Python string object pointer being directly set during use of string_pointer and mitigates the problem of buffer overrun when using string_array at instance/pointer_attribute.

This change will cause memory leak when using string_pointer if the string is not properly managed, but this is necessary to maintain memory safety in statements such as pointer.set_string_pointer("string").

CookStar commented 1 year ago

Are there any other issues?