diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-02-03 00:38:09 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-02-03 00:38:09 +0000 |
commit | 2907916b1b1626168388ab094cbadae5e0ea03ff (patch) | |
tree | 2c06d89a229d91d8a8bc814a35aa703717972df1 /sbin/iked | |
parent | a160631eeedf2cd54353352f34480c1b68b38a58 (diff) |
correct buffer size argument to snprintf in print_proto()
found by "snprintf() is printing too much 8192 vs 1024" smatch error
ok tobhe@ stsp@
Diffstat (limited to 'sbin/iked')
-rw-r--r-- | sbin/iked/util.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sbin/iked/util.c b/sbin/iked/util.c index c3c0c3e2900..2cd34d12b7c 100644 --- a/sbin/iked/util.c +++ b/sbin/iked/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.43 2023/07/28 11:23:03 claudio Exp $ */ +/* $OpenBSD: util.c,v 1.44 2024/02/03 00:38:08 jsg Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org> @@ -701,8 +701,7 @@ print_proto(uint8_t proto) if ((p = getprotobynumber(proto)) != NULL) strlcpy(buf[idx], p->p_name, sizeof(buf[idx])); else - snprintf(buf[idx], sizeof(buf), "%u", proto); - + snprintf(buf[idx], sizeof(buf[idx]), "%u", proto); return (buf[idx++]); } |