summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Stuehler <uwe@cvs.openbsd.org>2017-09-23 12:25:40 +0000
committerUwe Stuehler <uwe@cvs.openbsd.org>2017-09-23 12:25:40 +0000
commit6abc5996ef5fb748891f4f815d76113da0830553 (patch)
treed34cacb05d2fac1ffddd8737e08d05efd9e2966c
parent99a59d3e2689fce1a292f3028fcf621799ac0389 (diff)
Fix off by one in ctf_enc2name (who uses SIGNED BOOL anyway?)
ok mpi
-rw-r--r--usr.bin/ctfdump/ctfdump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ctfdump/ctfdump.c b/usr.bin/ctfdump/ctfdump.c
index f30e608e7be..6b3e035314b 100644
--- a/usr.bin/ctfdump/ctfdump.c
+++ b/usr.bin/ctfdump/ctfdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ctfdump.c,v 1.7 2017/09/23 12:24:31 uwe Exp $ */
+/* $OpenBSD: ctfdump.c,v 1.8 2017/09/23 12:25:39 uwe Exp $ */
/*
* Copyright (c) 2016 Martin Pieuchot <mpi@openbsd.org>
@@ -551,7 +551,7 @@ ctf_enc2name(uint16_t enc)
if (enc == CTF_INT_VARARGS)
return "VARARGS";
- if (enc > 0 && enc < nitems(enc_name))
+ if (enc > 0 && enc <= nitems(enc_name))
return enc_name[enc - 1];
snprintf(invalid, sizeof(invalid), "0x%x", enc);