about summary refs log tree commit diff
path: root/src/temp/mkostemp.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2016-04-26 15:26:40 -0400
committerRich Felker <dalias@aerifal.cx>2016-04-26 15:26:40 -0400
commit6ed791e768d83b40ed56c99dbb1ed72c1e49aae7 (patch)
treea31203a6ee0fe3131e4366867e5c7f48cbf58b45 /src/temp/mkostemp.c
parentbe999f7a54e81656ea0409030205177327a7450c (diff)
downloadmusl-6ed791e768d83b40ed56c99dbb1ed72c1e49aae7.tar.gz
musl-6ed791e768d83b40ed56c99dbb1ed72c1e49aae7.tar.xz
musl-6ed791e768d83b40ed56c99dbb1ed72c1e49aae7.zip
fix FILE buffer underflow in ungetwc
commit 7e816a6487932cbb3cb71d94b609e50e81f4e5bf (version 1.1.11
release cycle) moved the code that performs wchar_t to multibyte
conversion across code that used the resulting length in bytes,
thereby breaking the unget buffer space check in ungetwc and
clobbering up to three bytes below the start of the buffer.

for allocated FILEs (all read-enabled FILEs except stdin), the
underflow clobbers at most the FILE-specific locale pointer. no stores
are performed through this pointer, but subsequent loads may result in
a crash or mismatching encoding rule (UTF-8 multibyte vs byte-based).

for stdin, the buffer lies in .bss and the underflow may clobber
another object. in practice, for libc.so the adjacent object seems to
be stderr's buffer, which is completely unused, but this could vary
with linking options, or when static linking.

applications which do not attempt to use more than one character of
ungetwc pushback, or which do not use ungetwc, are not affected.
Diffstat (limited to 'src/temp/mkostemp.c')
0 files changed, 0 insertions, 0 deletions