plan9front/sys/src/libstdio
cinap_lenrek 6d42467411 stdio: fix sclose() buffer overrun when terminating string, realloc() error handling (thanks porlock)
theres a bug is in sclose() where it doesnt check if wp is beyond
the buffer. also wp was not updated after realloc().

bug was reported by porlock on 9fans:

Plan 9's implementation of the standard C functions snprintf and
vsnprintf have a buffer overrun bug.

If the buffer length equals the output length (without the terminating
null), then one too many characters is written to the buffer.

For example,
              snprintf(buf, 4, "ABCD");

will write 5 characters to buf.
2016-11-27 21:20:27 +01:00
..
Stdio.h
_IO_getc.c
_IO_putc.c stdio: fix sclose() buffer overrun when terminating string, realloc() error handling (thanks porlock) 2016-11-27 21:20:27 +01:00
clearerr.c
dtoa.c
fclose.c
fdopen.c
feof.c
ferror.c
fflush.c
fgetc.c
fgetpos.c
fgets.c
fileno.c
fopen.c
fprintf.c
fputc.c
fputs.c
fread.c
freopen.c
fscanf.c
fseek.c
fseeko.c
fsetpos.c
ftell.c
ftello.c
fwrite.c
getc.c
gets.c
iolib.h
mkfile
printf.c
putc.c
puts.c
rewind.c
scanf.c
sclose.c stdio: fix sclose() buffer overrun when terminating string, realloc() error handling (thanks porlock) 2016-11-27 21:20:27 +01:00
setbuf.c
setvbuf.c
snprintf.c
sopenr.c
sopenw.c
sprintf.c
sscanf.c
tmpfile.c
tmpnam.c
ungetc.c
vfprintf.c
vfscanf.c
vprintf.c
vsnprintf.c
vsprintf.c