~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to snmplib/snmp_client.c

  • Committer: Bazaar Package Importer
  • Author(s): Jochen Friedrich
  • Date: 2010-06-10 18:02:54 UTC
  • mto: (1.4.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100610180254-6ezvupl2clicwdqf
ImportĀ upstreamĀ versionĀ 5.4.3~dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
580
580
 * The command is set to the input command and the reqid, errstat, and
581
581
 * errindex are set to default values.
582
582
 * If the error status didn't indicate an error, the error index didn't
583
 
 * indicate a variable, the pdu wasn't a get response message, or there
 
583
 * indicate a variable, the pdu wasn't a get response message, the
 
584
 * marked variable was not present in the initial request, or there
584
585
 * would be no remaining variables, this function will return 0.
585
586
 * If everything was successful, a pointer to the fixed cloned pdu will
586
587
 * be returned.
593
594
    if ((pdu->command != SNMP_MSG_RESPONSE)
594
595
        || (pdu->errstat == SNMP_ERR_NOERROR)
595
596
        || (0 == pdu->variables)
 
597
        || (pdu->errindex > snmp_varbind_len(pdu))
596
598
        || (pdu->errindex <= 0)) {
597
599
        return 0;               /* pre-condition tests fail */
598
600
    }
642
644
{
643
645
    size_t          len = sizeof(oid) * name_length;
644
646
 
645
 
    if (vp->name != vp->name_loc && vp->name != NULL &&
646
 
        vp->name_length > (sizeof(vp->name_loc) / sizeof(oid))) {
 
647
    if (vp->name != vp->name_loc && vp->name != NULL) {
647
648
        /*
648
649
         * Probably previously-allocated "big storage".  Better free it
649
650
         * else memory leaks possible.  
1042
1043
            }
1043
1044
        }
1044
1045
 
1045
 
        if ( ss->flags &= SNMP_FLAGS_RESP_CALLBACK ) {
 
1046
        if ( ss->flags & SNMP_FLAGS_RESP_CALLBACK ) {
1046
1047
            void (*cb)(void);
1047
1048
            cb = ss->myvoid;
1048
1049
            cb();        /* Used to invoke 'netsnmp_check_outstanding_agent_requests();'