[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r6600 - in /fsf/trunk/libc: ChangeLog hurd/fd-read.c



Author: eglibc
Date: Tue Jul 22 00:04:11 2008
New Revision: 6600

Log:
Import glibc-mainline for 2008-07-22

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/hurd/fd-read.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Tue Jul 22 00:04:11 2008
@@ -1,3 +1,8 @@
+2008-07-21  Roland McGrath  <roland@xxxxxxxx>
+
+	* hurd/fd-read.c (_hurd_fd_read): Return EGRATUITOUS if the server
+	returned too much data out of line.
+
 2008-07-20  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* locale/setlocale.c (setname): Remove inline to avoid compiler

Modified: fsf/trunk/libc/hurd/fd-read.c
==============================================================================
--- fsf/trunk/libc/hurd/fd-read.c (original)
+++ fsf/trunk/libc/hurd/fd-read.c Tue Jul 22 00:04:11 2008
@@ -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 @@
 
   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);
     }