git: 0154a0df90c7 - stable/15 - bsnmpget: initialise the suboption value in getsubopt1()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 06 Oct 2026 17:39:26 UTC
The branch stable/15 has been updated by maxim:
URL: https://cgit.FreeBSD.org/src/commit/?id=0154a0df90c736d0c6d246b31f92c7becf71a86a
commit 0154a0df90c736d0c6d246b31f92c7becf71a86a
Author: Maxim Konovalov <maxim@FreeBSD.org>
AuthorDate: 2026-09-22 22:49:33 +0000
Commit: Maxim Konovalov <maxim@FreeBSD.org>
CommitDate: 2026-10-06 17:36:47 +0000
bsnmpget: initialise the suboption value in getsubopt1()
Otherwise, "bsnmpget -o verbose -I cut" crashes.
Reported by: clang static analyzer
MFC after: 2 weeks
(cherry picked from commit 5d169b5365b1f5cdf8586efa9421feaa4bfe40af)
---
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 d8fbb55290a8..4d1058629496 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++)