ydb-platform / ydb

YDB is an open source Distributed SQL Database that combines high availability and scalability with strong consistency and ACID transactions
https://ydb.tech
Apache License 2.0
3.5k stars 491 forks source link

IGNIETFERRO-2059: Fix a couple of string-related use-after-free errors #6072

Open ubyte opened 3 days ago

ubyte commented 3 days ago

Changelog entry

Fixed access to freed memory when the original string is destroyed earlier than the TStringBuf constructed from it.

Also, the construction of empty TStringBuf from an empty string has been replaced with direct construction, since, firstly, it is faster, and secondly, it does not lead to invalid pointers, the comparison/copying of which may be problematic in hardened environments:

Some implementations might define that copying an invalid pointer value causes a system-generated runtime fault.

Changelog category

github-actions[bot] commented 3 days ago

Hi! Thank you for contributing! The tests on this PR will run after a maintainer adds an ok-to-test label to this PR manually. Thank you for your patience!

github-actions[bot] commented 3 days ago

:white_circle: 2024-06-28 13:40:03 UTC Pre-commit check for 46c50bb08f1f468a339e0f97a94d8e5632f3719d has started. :white_circle: 2024-06-28 13:42:46 UTC Build linux-x86_64-release-clang14 is running... :red_circle: 2024-06-28 13:46:43 UTC Build failed. see the build logs.

github-actions[bot] commented 3 days ago

:white_circle: 2024-06-28 13:42:59 UTC Pre-commit check for 46c50bb08f1f468a339e0f97a94d8e5632f3719d has started. :white_circle: 2024-06-28 13:45:34 UTC Build linux-x86_64-relwithdebinfo is running... :red_circle: 2024-06-28 13:50:20 UTC Build failed. see the build logs.

github-actions[bot] commented 3 days ago

:white_circle: 2024-06-28 14:17:02 UTC Pre-commit check for 46c50bb08f1f468a339e0f97a94d8e5632f3719d has started. :white_circle: 2024-06-28 14:20:06 UTC Build linux-x86_64-release-asan is running... :red_circle: 2024-06-28 14:24:42 UTC Build failed. see the build logs.

ubyte commented 2 days ago

CI check: https://nda.ya.ru/t/6TXcB25k76fWK5