--- net-snmp-5.7.1/agent/mibgroup/agentx/client.c 2012-08-27 10:22:10.000000000 -0500 +++ net-snmp-5.7.1-patched/agent/mibgroup/agentx/client.c 2012-08-23 15:44:55.000000000 -0500 @@ -130,8 +130,10 @@ if (agentx_synch_response(ss, pdu, &response) != STAT_SUCCESS) return 0; - if (!response) + if (!response) { + DEBUGMSGTL(("agentx/subagent", "open NULL response\n")); return 0; + } if (response->errstat != SNMP_ERR_NOERROR) { snmp_free_pdu(response); @@ -216,7 +218,13 @@ return 0; } - if (response->errstat != SNMP_ERR_NOERROR) { + if (!response) { + DEBUGMSGTL(("agentx/subagent", "registering NULL response\n")); + return 0; + } + + if ((response->errstat != SNMP_ERR_NOERROR) && + (response->errstat != AGENTX_ERR_DUPLICATE_REGISTRATION)) { snmp_log(LOG_ERR,"registering pdu failed: %ld!\n", response->errstat); snmp_free_pdu(response); return 0; @@ -267,6 +275,11 @@ if (agentx_synch_response(ss, pdu, &response) != STAT_SUCCESS) return 0; + if (!response) { + DEBUGMSGTL(("agentx/subagent", "un-registering NULL response\n")); + return 0; + } + if (response->errstat != SNMP_ERR_NOERROR) { snmp_free_pdu(response); return 0; @@ -331,6 +344,11 @@ if (agentx_synch_response(ss, pdu, &response) != STAT_SUCCESS) return NULL; + if (!response) { + DEBUGMSGTL(("agentx/subagent", "register index NULL response\n")); + return 0; + } + if (response->errstat != SNMP_ERR_NOERROR) { snmp_free_pdu(response); return NULL; @@ -396,6 +414,11 @@ if (agentx_synch_response(ss, pdu, &response) != STAT_SUCCESS) return -1; + if (!response) { + DEBUGMSGTL(("agentx/subagent", "un-register index NULL response\n")); + return 0; + } + if (response->errstat != SNMP_ERR_NOERROR) { snmp_free_pdu(response); return -1; /* XXX - say why */ @@ -426,6 +449,11 @@ if (agentx_synch_response(ss, pdu, &response) != STAT_SUCCESS) return 0; + if (!response) { + DEBUGMSGTL(("agentx/subagent", "add agentcaps NULL response\n")); + return 0; + } + if (response->errstat != SNMP_ERR_NOERROR) { snmp_free_pdu(response); return 0; @@ -455,6 +483,11 @@ if (agentx_synch_response(ss, pdu, &response) != STAT_SUCCESS) return 0; + if (!response) { + DEBUGMSGTL(("agentx/subagent", "remove agentcaps NULL response\n")); + return 0; + } + if (response->errstat != SNMP_ERR_NOERROR) { snmp_free_pdu(response); return 0; @@ -482,6 +515,11 @@ if (agentx_synch_response(ss, pdu, &response) != STAT_SUCCESS) return 0; + if (!response) { + DEBUGMSGTL(("agentx/subagent", "ping NULL response\n")); + return 0; + } + if (response->errstat != SNMP_ERR_NOERROR) { snmp_free_pdu(response); return 0;