projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b5a8b28
)
also ensure that write buffer is bounded when __stdio_write returns
author
Rich Felker
<dalias@aerifal.cx>
Tue, 17 Apr 2012 15:08:11 +0000
(11:08 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Tue, 17 Apr 2012 15:08:11 +0000
(11:08 -0400)
assuming other code is correct, this should be a no-op, but better to
be safe...
src/stdio/__stdio_write.c
patch
|
blob
|
history
diff --git
a/src/stdio/__stdio_write.c
b/src/stdio/__stdio_write.c
index dd97cf68ac15f08a3c71fc6553418f39185539d4..da45673f23bfd1cad6f3b52fea458f3143e9a874 100644
(file)
--- 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;
}