← Winnitude! Search  ·  Reader Mode (1221 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 50 LINKS

Fix ownership issue for string_pointer and buffer overrun issue for string_array. (#472) by CookStar · Pull Request #474 · Source-Python-Dev-Team/Source.Python

Repository navigation

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


Open
CookStar wants to merge 5 commits into Source-Python-Dev-Team:master from CookStar:fix_string
Open

Fix ownership issue for string_pointer and buffer overrun issue for string_array. (#472) #474 CookStar wants to merge 5 commits into Source-Python-Dev-Team:master from CookStar:fix_string

Conversation

CookStar commented May 21, 2023



Copy link Copy Markdown
Contributor

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 added 2 commits May 21, 2023 09:50 Fixed set_string_pointer to always create a new string object. 029391b Changed instance/pointer_attribute to accept length when using string... 3a5124d
..._array to prevent buffer overrun.
CookStar mentioned this pull request May 21, 2023 Who manages STRING_ARRAY/STRING_POINTER? #472 Closed CookStar marked this pull request as draft May 22, 2023 04:14 CookStar marked this pull request as ready for review May 22, 2023 18:20 Fixed support for UTF8. 88f708a
Fixed missing support for based_attribute.

Modified the description of SetStringPointer.
CookStar force-pushed the fix_string branch from c1f8b81 to 88f708a
Compare
May 23, 2023 03:54 Fixed SetStringPointer unable to accept None. 8d7a3b4 jordanbriere reviewed May 27, 2023
View reviewed changes
jordanbriere reviewed May 27, 2023
View reviewed changes
Fixed an error for MSVC. 9fefc1e
Added space to error description.

CookStar commented Jun 6, 2023



Copy link Copy Markdown
Contributor

Author

Are there any other issues?

CookStar mentioned this pull request Jun 28, 2023 TypeManager.pointer_attribute cannot be safely used in nested CustomType. #480 Closed

This branch has not been deployed


No deployments
Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment

Labels

None yet

2 participants