Skip to content

Commit ca51e58

Browse files
committed
snmptrapd: Really fix a buffer overflow triggered by an empty enterprise OID
Fixes: ce1c9d4 ("snmptrapd: Fix a buffer overflow triggered by an empty enterprise OID") Fixes: https://issues.oss-fuzz.com/issues/471518953
1 parent 1d79f40 commit ca51e58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/snmptrapd_handlers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ snmp_input(int op, netsnmp_session *session,
11151115
if (pdu->trap_type == SNMP_TRAP_ENTERPRISESPECIFIC) {
11161116
trapOidLen = pdu->enterprise_length;
11171117
memcpy(trapOid, pdu->enterprise, sizeof(oid) * trapOidLen);
1118-
if (trapOidLen >= 0 && trapOid[trapOidLen - 1] != 0) {
1118+
if (trapOidLen > 0 && trapOid[trapOidLen - 1] != 0) {
11191119
trapOid[trapOidLen++] = 0;
11201120
}
11211121
trapOid[trapOidLen++] = pdu->specific_type;

0 commit comments

Comments
 (0)