From 7385c04c8c477ff3728a61d9335628337cf9edc1 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 22 Jul 2008 20:21:19 +0000 Subject: * hurd/fd-read.c (_hurd_fd_read): Fix last change. --- ChangeLog | 4 ++++ hurd/fd-read.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 88343cf..daccb37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-07-22 Roland McGrath + + * hurd/fd-read.c (_hurd_fd_read): Fix last change. + 2008-07-21 Roland McGrath * hurd/fd-read.c (_hurd_fd_read): Return EGRATUITOUS if the server diff --git a/hurd/fd-read.c b/hurd/fd-read.c index d673c78..3870652 100644 --- a/hurd/fd-read.c +++ b/hurd/fd-read.c @@ -42,7 +42,10 @@ _hurd_fd_read (struct hurd_fd *fd, void *buf, size_t *nbytes, loff_t offset) if (data != buf) { if (nread > *nbytes) /* Sanity check for bogus server. */ - return EGRATUITOUS; + { + __vm_deallocate (__mach_task_self (), (vm_address_t) data, nread); + return EGRATUITOUS; + } memcpy (buf, data, nread); __vm_deallocate (__mach_task_self (), (vm_address_t) data, nread); } -- cgit v1.1