From: Eric McDonald Date: Thu, 4 Dec 2025 17:48:16 +0000 (-0800) Subject: net-snmp: fix literal string test in snmpd_sink_add X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=feed%2Fpackages.git net-snmp: fix literal string test in snmpd_sink_add The function snmpd_sink_add() has a guard clause that tests the literal string "section", not the variable value "$section". The test `[ -n "section" ]` always evaluates to true because the string literal "section" is non-empty, making the check useless. This function is only called internally with hardcoded arguments, so the bug has no actual impact currently. For the same reason, this change should not break existing configurations. However, I think it should be fixed so future callers do not have a false sense of security. Signed-off-by: Eric McDonald --- diff --git a/net/net-snmp/files/snmpd.init b/net/net-snmp/files/snmpd.init index e28e54ec8c..78df7c9a2b 100644 --- a/net/net-snmp/files/snmpd.init +++ b/net/net-snmp/files/snmpd.init @@ -233,7 +233,7 @@ snmpd_sink_add() { local host config_get host "$cfg" host - [ -n "section" -a -n "$host" ] || return 0 + [ -n "$section" -a -n "$host" ] || return 0 # optional community config_get community "$cfg" community # optional port