diff options
author | 2009-06-05 16:39:39 +0000 | |
---|---|---|
committer | 2009-06-05 16:39:39 +0000 | |
commit | 5915e5148298820550bb670516184eb7051cc8d8 (patch) | |
tree | 9289c3ae19f3f377a9f6fc83345fb604e065be12 /lib/libc | |
parent | tidy up promiscuous mode and multicast handling; from Brad; ok sthen@ (diff) | |
download | wireguard-openbsd-5915e5148298820550bb670516184eb7051cc8d8.tar.xz wireguard-openbsd-5915e5148298820550bb670516184eb7051cc8d8.zip |
An empty sting cannot be used as a YP domain name,
so treat it similarly to a failing call to getdomainname.
ok millert@
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/yp/yp_get_default_domain.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/yp/yp_get_default_domain.c b/lib/libc/yp/yp_get_default_domain.c index a752e094e9e..d48e3d1eddf 100644 --- a/lib/libc/yp/yp_get_default_domain.c +++ b/lib/libc/yp/yp_get_default_domain.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yp_get_default_domain.c,v 1.6 2005/08/05 13:02:16 espie Exp $ */ +/* $OpenBSD: yp_get_default_domain.c,v 1.7 2009/06/05 16:39:39 schwarze Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com> * All rights reserved. @@ -42,5 +42,7 @@ yp_get_default_domain(char **domp) if (getdomainname(_yp_domain, sizeof _yp_domain)) return YPERR_NODOM; *domp = _yp_domain; + if (_yp_domain[0] == '\0') + return YPERR_NODOM; return 0; } |