From b7a2761780c28cd0167ce4e51623e42298096708 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 17 Apr 2012 11:08:11 -0400 Subject: [PATCH] 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... --- src/stdio/__stdio_write.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.20.1