aboutsummaryrefslogtreecommitdiff
path: root/iconvdata/testdata/CP1254
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2025-01-22 13:48:56 +0100
committerFlorian Weimer <fweimer@redhat.com>2025-01-23 17:43:15 +0100
commitb62759db04b8ed7f829c06f1d7c3b8fb70616493 (patch)
treeec0a519968d10625281774ffe06ed73ad0feaa6f /iconvdata/testdata/CP1254
parent76c3f7f81b7b99fedbff6edc07cddff59e2ae6e2 (diff)
downloadglibc-master.zip
glibc-master.tar.gz
glibc-master.tar.bz2
stdlib: Support malloc-managed environ arrays for compatibilityHEADmaster
Some applications set environ to a heap-allocated pointer, call setenv (expecting it to call realloc), free environ, and then restore the original environ pointer. This breaks after commit 7a61e7f557a97ab597d6fca5e2d1f13f65685c61 ("stdlib: Make getenv thread-safe in more cases") because after the setenv call, the environ pointer does not point to the start of a heap allocation. Instead, setenv creates a separate allocation and changes environ to point into that. This means that the free call in the application results in heap corruption. The interim approach was more compatible with other libcs because it does not assume that the incoming environ pointer is allocated as if by malloc (if it was written by the application). However, it seems to be more important to stay compatible with previous glibc version: assume the incoming pointer is heap allocated, and preserve this property after setenv calls. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'iconvdata/testdata/CP1254')
0 files changed, 0 insertions, 0 deletions