diff options
Diffstat (limited to 'sbin/ipsecctl/pfkdump.c')
-rw-r--r-- | sbin/ipsecctl/pfkdump.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/ipsecctl/pfkdump.c b/sbin/ipsecctl/pfkdump.c index 77fd8182552..3ab5ea17c4c 100644 --- a/sbin/ipsecctl/pfkdump.c +++ b/sbin/ipsecctl/pfkdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkdump.c,v 1.48 2018/08/28 15:17:56 mpi Exp $ */ +/* $OpenBSD: pfkdump.c,v 1.49 2019/07/03 03:24:02 deraadt Exp $ */ /* * Copyright (c) 2003 Markus Friedl. All rights reserved. @@ -261,11 +261,11 @@ print_flags(uint32_t flags) { static char fstr[80]; struct idname *entry; - size_t len; + int len; int i, comma = 0, n; len = snprintf(fstr, sizeof(fstr), "%#x<", flags); - if (len >= sizeof(fstr)) + if (len < 0 || len >= sizeof(fstr)) return (NULL); for (i = 0; i < 32; i++) { if ((flags & (1 << i)) == 0 || @@ -273,7 +273,7 @@ print_flags(uint32_t flags) continue; n = snprintf(fstr + len, sizeof(fstr) - len - 1, comma ? ",%s" : "%s", entry->name); - if ((size_t)n >= sizeof(fstr) - len - 1) + if (n < 0 || n >= sizeof(fstr) - len - 1) return (NULL); len += n; comma = 1; |