summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2005-10-20 09:09:49 +0000
committerotto <otto@openbsd.org>2005-10-20 09:09:49 +0000
commit1c09f9c3556af44d87afac1c46e0daa4e2bb7854 (patch)
tree6a2f9bc0d6068238c6dfb6b9e055416bd064c997
parenttalk about choices when describing -y; from chris.kuethe@gmail.com ok fgsch (diff)
downloadwireguard-openbsd-1c09f9c3556af44d87afac1c46e0daa4e2bb7854.tar.xz
wireguard-openbsd-1c09f9c3556af44d87afac1c46e0daa4e2bb7854.zip
A library should not return EFAULT. Just segfault if a bogus or
NULL pointer is passed in. ok espie@
-rw-r--r--lib/libc/locale/setrunelocale.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c
index 6e8d2fa17f4..47a47b9042d 100644
--- a/lib/libc/locale/setrunelocale.c
+++ b/lib/libc/locale/setrunelocale.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: setrunelocale.c,v 1.1 2005/08/07 10:16:24 espie Exp $ */
+/* $OpenBSD: setrunelocale.c,v 1.2 2005/10/20 09:09:49 otto Exp $ */
/* $NetBSD: setrunelocale.c,v 1.14 2003/08/07 16:43:07 agc Exp $ */
/*-
@@ -137,10 +137,8 @@ _newrunelocale(const char *path)
FILE *fp;
_RuneLocale *rl;
- /* path may be NULL (actually, it's checked below) */
-
- if (!path || strlen(path) + 1 > sizeof(lt->path))
- return EFAULT;
+ if (strlen(path) + 1 > sizeof(lt->path))
+ return EINVAL;
rl = _findrunelocale(path);
if (rl)