b5ae06
983116: net-snmp query fails after update to 1:5.5-44.el6_4.2
b5ae06
b5ae06
b5ae06
commit e41c2f574c25d8dd273f2406eeeac19bc2ae16db
b5ae06
Author: Jan Safranek <jsafranek@users.sourceforge.net>
b5ae06
Date:   Mon Aug 12 14:30:51 2013 +0200
b5ae06
b5ae06
    CHANGES: snmplib: Fixed parsing of sequences.
b5ae06
    
b5ae06
    Don't overwrite 'data' variable, it's used when parsing bulk responses.
b5ae06
b5ae06
diff --git a/snmplib/snmp_api.c b/snmplib/snmp_api.c
b5ae06
index 403ea2b..e67945f 100644
b5ae06
--- a/snmplib/snmp_api.c
b5ae06
+++ b/snmplib/snmp_api.c
b5ae06
@@ -4537,6 +4537,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length)
b5ae06
     size_t          four;
b5ae06
     netsnmp_variable_list *vp = NULL;
b5ae06
     oid             objid[MAX_OID_LEN];
b5ae06
+    u_char         *p;
b5ae06
 
b5ae06
     /*
b5ae06
      * Get the PDU type 
b5ae06
@@ -4709,10 +4710,10 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length)
b5ae06
         case ASN_INTEGER:
b5ae06
             vp->val.integer = (long *) vp->buf;
b5ae06
             vp->val_len = sizeof(long);
b5ae06
-            data = asn_parse_int(var_val, &len, &vp->type,
b5ae06
+            p = asn_parse_int(var_val, &len, &vp->type,
b5ae06
                           (long *) vp->val.integer,
b5ae06
                           sizeof(*vp->val.integer));
b5ae06
-            if (!data)
b5ae06
+            if (!p)
b5ae06
                 return -1;
b5ae06
             break;
b5ae06
         case ASN_COUNTER:
b5ae06
@@ -4721,10 +4722,10 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length)
b5ae06
         case ASN_UINTEGER:
b5ae06
             vp->val.integer = (long *) vp->buf;
b5ae06
             vp->val_len = sizeof(u_long);
b5ae06
-            data = asn_parse_unsigned_int(var_val, &len, &vp->type,
b5ae06
+            p = asn_parse_unsigned_int(var_val, &len, &vp->type,
b5ae06
                                    (u_long *) vp->val.integer,
b5ae06
                                    vp->val_len);
b5ae06
-            if (!data)
b5ae06
+            if (!p)
b5ae06
                 return -1;
b5ae06
             break;
b5ae06
 #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
b5ae06
@@ -4734,37 +4735,37 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length)
b5ae06
         case ASN_COUNTER64:
b5ae06
             vp->val.counter64 = (struct counter64 *) vp->buf;
b5ae06
             vp->val_len = sizeof(struct counter64);
b5ae06
-            data = asn_parse_unsigned_int64(var_val, &len, &vp->type,
b5ae06
+            p = asn_parse_unsigned_int64(var_val, &len, &vp->type,
b5ae06
                                      (struct counter64 *) vp->val.
b5ae06
                                      counter64, vp->val_len);
b5ae06
-            if (!data)
b5ae06
+            if (!p)
b5ae06
                 return -1;
b5ae06
             break;
b5ae06
 #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
b5ae06
         case ASN_OPAQUE_FLOAT:
b5ae06
             vp->val.floatVal = (float *) vp->buf;
b5ae06
             vp->val_len = sizeof(float);
b5ae06
-            data = asn_parse_float(var_val, &len, &vp->type,
b5ae06
+            p = asn_parse_float(var_val, &len, &vp->type,
b5ae06
                             vp->val.floatVal, vp->val_len);
b5ae06
-            if (!data)
b5ae06
+            if (!p)
b5ae06
                 return -1;
b5ae06
             break;
b5ae06
         case ASN_OPAQUE_DOUBLE:
b5ae06
             vp->val.doubleVal = (double *) vp->buf;
b5ae06
             vp->val_len = sizeof(double);
b5ae06
-            data = asn_parse_double(var_val, &len, &vp->type,
b5ae06
+            p = asn_parse_double(var_val, &len, &vp->type,
b5ae06
                              vp->val.doubleVal, vp->val_len);
b5ae06
-            if (!data)
b5ae06
+            if (!p)
b5ae06
                 return -1;
b5ae06
             break;
b5ae06
         case ASN_OPAQUE_I64:
b5ae06
             vp->val.counter64 = (struct counter64 *) vp->buf;
b5ae06
             vp->val_len = sizeof(struct counter64);
b5ae06
-            data = asn_parse_signed_int64(var_val, &len, &vp->type,
b5ae06
+            p = asn_parse_signed_int64(var_val, &len, &vp->type,
b5ae06
                                    (struct counter64 *) vp->val.counter64,
b5ae06
                                    sizeof(*vp->val.counter64));
b5ae06
 
b5ae06
-            if (!data)
b5ae06
+            if (!p)
b5ae06
                 return -1;
b5ae06
             break;
b5ae06
 #endif                          /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
b5ae06
@@ -4783,15 +4784,15 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length)
b5ae06
             if (vp->val.string == NULL) {
b5ae06
                 return -1;
b5ae06
             }
b5ae06
-            data = asn_parse_string(var_val, &len, &vp->type, vp->val.string,
b5ae06
+            p = asn_parse_string(var_val, &len, &vp->type, vp->val.string,
b5ae06
                              &vp->val_len);
b5ae06
-            if (!data)
b5ae06
+            if (!p)
b5ae06
                 return -1;
b5ae06
             break;
b5ae06
         case ASN_OBJECT_ID:
b5ae06
             vp->val_len = MAX_OID_LEN;
b5ae06
-            data = asn_parse_objid(var_val, &len, &vp->type, objid, &vp->val_len);
b5ae06
-            if (!data)
b5ae06
+            p = asn_parse_objid(var_val, &len, &vp->type, objid, &vp->val_len);
b5ae06
+            if (!p)
b5ae06
                 return -1;
b5ae06
             vp->val_len *= sizeof(oid);
b5ae06
             vp->val.objid = (oid *) malloc(vp->val_len);
b5ae06
@@ -4810,9 +4811,9 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length)
b5ae06
             if (vp->val.bitstring == NULL) {
b5ae06
                 return -1;
b5ae06
             }
b5ae06
-            data = asn_parse_bitstring(var_val, &len, &vp->type,
b5ae06
+            p = asn_parse_bitstring(var_val, &len, &vp->type,
b5ae06
                                 vp->val.bitstring, &vp->val_len);
b5ae06
-            if (!data)
b5ae06
+            if (!p)
b5ae06
                 return -1;
b5ae06
             break;
b5ae06
         default: