This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug locale/25123] Heap use-after-free in setlocale
- From: "v.manhnd at vincss dot net" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Mon, 21 Oct 2019 16:11:37 +0000
- Subject: [Bug locale/25123] Heap use-after-free in setlocale
- Auto-submitted: auto-generated
- References: <bug-25123-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=25123
--- Comment #4 from Nguyễn Đức Mạnh <v.manhnd at vincss dot net> ---
(In reply to Florian Weimer from comment #3)
> The Perl coded looks invalid, particularly for multi-threaded code. On
> POSIX, it should use uselocale to temporarily change the locale for the
> current thread.
>
> That being said, you can make a copy of the returned string using strdup,
> and use that in the second setlocale call.
Please explain the usage of the return value of setlocale. As
https://linux.die.net/man/3/setlocale says, "The string returned is such that a
subsequent call with that string and its associated category will restore that
part of the process's locale." I see Perl follows this. Usage of strdup is not
mentioned anywhere in documents.
--
You are receiving this mail because:
You are on the CC list for the bug.