git: 5d169b5365b1 - main - bsnmpget: initialise the suboption value in getsubopt1()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 22 Sep 2026 22:57:18 UTC
The branch main has been updated by maxim:
URL: https://cgit.FreeBSD.org/src/commit/?id=5d169b5365b1f5cdf8586efa9421feaa4bfe40af
commit 5d169b5365b1f5cdf8586efa9421feaa4bfe40af
Author: Maxim Konovalov <maxim@FreeBSD.org>
AuthorDate: 2026-09-22 22:49:33 +0000
Commit: Maxim Konovalov <maxim@FreeBSD.org>
CommitDate: 2026-09-22 22:56:28 +0000
bsnmpget: initialise the suboption value in getsubopt1()
Otherwise, "bsnmpget -o verbose -I cut" crashes.
Reported by: clang static analyzer
MFC after: 2 weeks
---
usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
index 4c53555407de..857bb205b9b4 100644
--- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
+++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
@@ -316,6 +316,7 @@ getsubopt1(char **arg, const char *const *options, char **valp, char **optp)
char *ptr;
*optp = NULL;
+ *valp = NULL;
/* Skip leading junk. */
for (ptr = *arg; *ptr != '\0'; ptr++)