the result in an int check for > INT_MAX instead. OK bluhm@
-/* $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.
/* 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));
}