Fixed: [clixon_snmp module crashes on snmpwalk command](https://github.com/clicon/clixon/issues/378)

This commit is contained in:
Olof hagsand 2022-10-07 17:53:25 +02:00
parent 11eccd5478
commit d29c81fce0
3 changed files with 9 additions and 7 deletions

View file

@ -633,8 +633,8 @@ type_xml2snmp_pre(char *xmlstr0,
char *str = NULL;
int ret;
if (xmlstr1 == NULL){
clicon_err(OE_UNIX, EINVAL, "xmlstr1");
if (xmlstr0 == NULL || xmlstr1 == NULL){
clicon_err(OE_UNIX, EINVAL, "xmlstr0/1 is NULL");
goto done;
}
/* Get yang type of leaf and trasnslate to ASN.1 */