summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2016-02-05 04:10:48 +0000
committerjsg <jsg@openbsd.org>2016-02-05 04:10:48 +0000
commitb4ab25049afbfb3639470dc94dd6670431f509b4 (patch)
tree478451caa1c4371f05cd64e4515f9b8886cf4e09 /lib/libc
parentmention internal DH-GEX fallback groups; bz#2302 (diff)
downloadwireguard-openbsd-b4ab25049afbfb3639470dc94dd6670431f509b4.tar.xz
wireguard-openbsd-b4ab25049afbfb3639470dc94dd6670431f509b4.zip
avoid an uninitialised value in a return path added in rev 1.5
ok tobias@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/locale/rune.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/locale/rune.c b/lib/libc/locale/rune.c
index 83a65536688..7774859df86 100644
--- a/lib/libc/locale/rune.c
+++ b/lib/libc/locale/rune.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rune.c,v 1.5 2015/12/06 11:54:59 tobias Exp $ */
+/* $OpenBSD: rune.c,v 1.6 2016/02/05 04:10:48 jsg Exp $ */
/* $NetBSD: rune.c,v 1.26 2004/05/09 11:26:33 kleink Exp $ */
/*-
@@ -129,8 +129,10 @@ readentry(_RuneRange *rr, FILE *fp)
continue;
}
- if (re[i].re_max < re[i].re_min)
+ if (re[i].re_max < re[i].re_min) {
+ error = EINVAL;
goto fail;
+ }
l = re[i].re_max - re[i].re_min + 1;
re[i].re_rune_types = calloc(l, sizeof(_RuneType));