diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-04-17 11:08:11 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-04-17 11:08:11 -0400 |
commit | b7a2761780c28cd0167ce4e51623e42298096708 (patch) | |
tree | 6919a6a6dd831974f785ca9b698387cb69e89118 /src/stdio | |
parent | b5a8b28915aad17b6f49ccacd6d3fef3890844d1 (diff) | |
download | musl-b7a2761780c28cd0167ce4e51623e42298096708.tar.gz musl-b7a2761780c28cd0167ce4e51623e42298096708.tar.xz musl-b7a2761780c28cd0167ce4e51623e42298096708.zip |
also ensure that write buffer is bounded when __stdio_write returns
assuming other code is correct, this should be a no-op, but better to be safe...
Diffstat (limited to 'src/stdio')
-rw-r--r-- | src/stdio/__stdio_write.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/stdio/__stdio_write.c b/src/stdio/__stdio_write.c index dd97cf68..da45673f 100644 --- a/src/stdio/__stdio_write.c +++ b/src/stdio/__stdio_write.c @@ -22,6 +22,7 @@ size_t __stdio_write(FILE *f, const unsigned char *buf, size_t len) cnt = syscall_cp(SYS_writev, f->fd, iov, iovcnt); pthread_cleanup_pop(0); if (cnt == rem) { + f->wend = f->buf + f->buf_size; f->wpos = f->wbase = f->buf; return len; } |