From fc842bcc02dea1dc7fe1b1ec158cf816d7adf25b Mon Sep 17 00:00:00 2001 From: ngie Date: Sat, 14 May 2016 21:27:33 +0000 Subject: Use the size of the destination buffer, not the source buffer. Technically this is a no-op, but mute the clang warning in case the malloc call above for fstring ever changes in the future Reported by: clang MFC after: 1 week Sponsored by: EMC / Isilon Storage Division --- usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.sbin/bsnmpd') diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c index 1f59f71..4ab229d 100644 --- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c +++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c @@ -264,7 +264,7 @@ add_filename(struct snmp_toolinfo *snmptoolctx, const char *filename, if (cut != NULL) asn_append_oid(&(entry->cut), cut); - strlcpy(fstring, filename, strlen(filename) + 1); + strlcpy(fstring, filename, sizeof(fstring)); entry->name = fstring; entry->done = done; SLIST_INSERT_HEAD(&snmptoolctx->filelist, entry, link); -- cgit v1.1