Skip to content

Conversation

@victorshcherbakov
Copy link

When I tested this library on Linux Manjaro 6.6.85 with enabled ASAN I faced with the issue heep-use-after-free.

As I understood it's necessary to make a deep copy of the returned value from setlocale, because during the next call of this function, the returned memory can be freed.
Also https://en.cppreference.com/w/cpp/locale/setlocale recommends making a deep copy.
When I looked at the setlocale implementation in glibc 2.41 (it's a version from my system) I see that there is a chance of such behaviour (a returned memory can be freed):
https://github.com/bminor/glibc/blob/release/2.41/master/locale/setlocale.c#L395
I made such a fix and now everything is OK.

My compiler is clang 19.1.7.

@github-actions
Copy link
Contributor

github-actions bot commented May 19, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@victorshcherbakov
Copy link
Author

@victorshcherbakov please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

@s-perron s-perron moved this to For MSFT in HLSL Triage May 29, 2025
@s-perron s-perron requested review from pow2clk and tex3d May 29, 2025 19:35
@damyanp
Copy link
Member

damyanp commented Oct 15, 2025

Related #7506

@damyanp
Copy link
Member

damyanp commented Oct 15, 2025

We think that #7506 supercedes this one. We should double check that this is the case, but for now we'll close this PR.

@damyanp damyanp closed this Oct 15, 2025
@github-project-automation github-project-automation bot moved this from For MSFT to Triaged in HLSL Triage Oct 15, 2025
@github-project-automation github-project-automation bot moved this from New to Done in HLSL Roadmap Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done
Status: Triaged

Development

Successfully merging this pull request may close these issues.

3 participants