diff options
author | 2017-04-27 23:54:08 +0000 | |
---|---|---|
committer | 2017-04-27 23:54:08 +0000 | |
commit | 3123b2cb92f9dffb8297928ef299880de6b0e7d8 (patch) | |
tree | b28de365cc6869f7d9c0497612a28dede3f2d62b /lib/libc | |
parent | Remove "len < 0" check; len is socklen_t (uint32_t) so can't be (diff) | |
download | wireguard-openbsd-3123b2cb92f9dffb8297928ef299880de6b0e7d8.tar.xz wireguard-openbsd-3123b2cb92f9dffb8297928ef299880de6b0e7d8.zip |
ntohl() returns uint32_t so it cannot be < 0. Since we're storing
the result in an int check for > INT_MAX instead. OK bluhm@
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/nls/catopen.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/nls/catopen.c b/lib/libc/nls/catopen.c index af7869bdc7c..e03ebaf0a90 100644 --- a/lib/libc/nls/catopen.c +++ b/lib/libc/nls/catopen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: catopen.c,v 1.20 2016/09/21 04:38:56 guenther Exp $ */ +/* $OpenBSD: catopen.c,v 1.21 2017/04/27 23:54:08 millert Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. * All rights reserved. @@ -266,7 +266,7 @@ verify_msgcat(nl_catd catd) /* retrieve largest string offset */ for (j = index; j < nmsgs; j++) { - if (ntohl(msg[j].__offset) < 0) + if (ntohl(msg[j].__offset) > INT_MAX) return (1); off = MAXIMUM(off, ntohl(msg[j].__offset)); } |