diff options
author | Pino Toscano <toscano.pino@tiscali.it> | 2012-05-10 15:35:47 -0700 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2012-05-11 12:25:29 +0800 |
commit | ace0c4cd61ac66bf75946a567f69689b0700d8c6 (patch) | |
tree | 5692d8fd93a3b1e401fa05dc0fe83cf25b62a046 /hurd | |
parent | b09082f30a23f9c747fbbcc1ce0e3301b6164ece (diff) |
Hurd: hurdsock: reject negative domains
(cherry picked from commit 63643c85d4c47512decc16f35124160629c39a86)
Conflicts:
ChangeLog
Diffstat (limited to 'hurd')
-rw-r--r-- | hurd/hurdsock.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hurd/hurdsock.c b/hurd/hurdsock.c index 170a3f6185..2eda3653bb 100644 --- a/hurd/hurdsock.c +++ b/hurd/hurdsock.c @@ -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); |