]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Hurd: hurdsock: reject negative domains
authorPino Toscano <toscano.pino@tiscali.it>
Thu, 10 May 2012 22:35:47 +0000 (15:35 -0700)
committerRoland McGrath <roland@hack.frob.com>
Thu, 10 May 2012 22:57:28 +0000 (15:57 -0700)
ChangeLog
hurd/hurdsock.c

index 6f59a1ee09c682803c5decb517bfd96a23716a76..b1dbcba1970172d0f1628214289f11c0cb8a0d60 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-10  Pino Toscano  <toscano.pino@tiscali.it>
+
+       * hurd/hurdsock.c (_hurd_socket_server): Check for negative domains,
+       and reject them.
+
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
        * sysdeps/mach/hurd/setresgid.c (__setresgid): Handle the -1 case,
index f3611ecf2711ae64a14cbf395a242445e4a0b2b8..4b32ad431435a0d62133c5156913fb77d3c5c62e 100644 (file)
@@ -1,5 +1,5 @@
 /* _hurd_socket_server - Find the server for a socket domain.
-   Copyright (C) 1991,92,93,94,95,97,99 Free Software Foundation, Inc.
+   Copyright (C) 1991-2012 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
@@ -46,6 +46,12 @@ _hurd_socket_server (int domain, int dead)
 {
   socket_t server;
 
+  if (domain < 0)
+    {
+      errno = EAFNOSUPPORT;
+      return MACH_PORT_NULL;
+    }
+
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&lock);