diff options
author | Jakub Jelinek <jakub@redhat.com> | 2008-07-28 23:34:19 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2008-07-28 23:34:19 +0000 |
commit | c7045198ca8f4ff5b97205340d51127f8503c2bd (patch) | |
tree | 387ee7a78760f683df6035af28d665e3972aa30b /hurd/fd-read.c | |
parent | c83494a925f4b4b716f9ba3abcb5e695d3e2a8a9 (diff) | |
download | glibc-c7045198ca8f4ff5b97205340d51127f8503c2bd.tar glibc-c7045198ca8f4ff5b97205340d51127f8503c2bd.tar.gz glibc-c7045198ca8f4ff5b97205340d51127f8503c2bd.tar.bz2 glibc-c7045198ca8f4ff5b97205340d51127f8503c2bd.zip |
Updated to fedora-glibc-20080728T2320cvs/fedora-glibc-2_8_90-10
Diffstat (limited to 'hurd/fd-read.c')
-rw-r--r-- | hurd/fd-read.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hurd/fd-read.c b/hurd/fd-read.c index 388a4dbaf9..38706524f0 100644 --- a/hurd/fd-read.c +++ b/hurd/fd-read.c @@ -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,11 @@ _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. */ + { + __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); } |