mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-08 18:30:18 +00:00
2008-07-21 Roland McGrath <roland@frob.com>
* hurd/fd-read.c (_hurd_fd_read): Return EGRATUITOUS if the server returned too much data out of line.
This commit is contained in:
parent
2e79213a36
commit
2e806440f9
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1993,94,95,97,99,2002 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993,94,95,97,99,2002,2008 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -41,6 +41,8 @@ _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;
|
||||
memcpy (buf, data, nread);
|
||||
__vm_deallocate (__mach_task_self (), (vm_address_t) data, nread);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user