SNMP octet scring has a defined length and does not need a null separator
This commit is contained in:
parent
4138f390d4
commit
891b0b0c9e
1 changed files with 4 additions and 3 deletions
|
|
@ -917,11 +917,12 @@ type_xml2snmp(char *snmpstr,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ASN_OCTET_STR: // 4
|
case ASN_OCTET_STR: // 4
|
||||||
*snmplen = strlen(snmpstr)+1;
|
*snmplen = strlen(snmpstr);
|
||||||
if ((*snmpval = (u_char*)strdup((snmpstr))) == NULL){
|
if ((*snmpval = malloc(*snmplen)) == NULL){
|
||||||
clixon_err(OE_UNIX, errno, "strdup");
|
clixon_err(OE_UNIX, errno, "malloc");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
memcpy(*snmpval, snmpstr, *snmplen);
|
||||||
break;
|
break;
|
||||||
case ASN_COUNTER64:{ // 0x46 / 70
|
case ASN_COUNTER64:{ // 0x46 / 70
|
||||||
uint64_t u64;
|
uint64_t u64;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue