dont write past buffer end, ok armani@

This commit is contained in:
Alexandre Ratchov 2012-11-10 22:57:49 +01:00
parent bf045ccb03
commit 6fa4f57d50
1 changed files with 1 additions and 1 deletions

View File

@ -612,7 +612,7 @@ sock_wdata(struct sock *f)
data = abuf_rgetblk(buf, &count);
if (count > f->wtodo)
count = f->wtodo;
n = sock_fdwrite(f, data, f->wtodo);
n = sock_fdwrite(f, data, count);
if (n == 0)
return 0;
f->wtodo -= n;