Commit a548d5a2 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

inetmib1: Check return values from SnmpUtilOid functions in utility functions.

parent 7a1f305d
......@@ -431,45 +431,61 @@ static AsnInteger32 getItemAndInstanceFromTable(AsnObjectIdentifier *oid,
return ret;
}
static void setOidWithItem(AsnObjectIdentifier *dst, AsnObjectIdentifier *base,
static INT setOidWithItem(AsnObjectIdentifier *dst, AsnObjectIdentifier *base,
UINT item)
{
UINT id;
AsnObjectIdentifier oid;
INT ret;
SnmpUtilOidCpy(dst, base);
oid.idLength = 1;
oid.ids = &id;
id = item;
SnmpUtilOidAppend(dst, &oid);
ret = SnmpUtilOidCpy(dst, base);
if (ret)
{
oid.idLength = 1;
oid.ids = &id;
id = item;
ret = SnmpUtilOidAppend(dst, &oid);
}
return ret;
}
static void setOidWithItemAndIpAddr(AsnObjectIdentifier *dst,
static INT setOidWithItemAndIpAddr(AsnObjectIdentifier *dst,
AsnObjectIdentifier *base, UINT item, DWORD addr)
{
UINT id;
BYTE *ptr;
AsnObjectIdentifier oid;
INT ret;
setOidWithItem(dst, base, item);
oid.idLength = 1;
oid.ids = &id;
for (ptr = (BYTE *)&addr; ptr < (BYTE *)&addr + sizeof(DWORD); ptr++)
ret = setOidWithItem(dst, base, item);
if (ret)
{
id = *ptr;
SnmpUtilOidAppend(dst, &oid);
oid.idLength = 1;
oid.ids = &id;
for (ptr = (BYTE *)&addr; ret && ptr < (BYTE *)&addr + sizeof(DWORD);
ptr++)
{
id = *ptr;
ret = SnmpUtilOidAppend(dst, &oid);
}
}
return ret;
}
static void setOidWithItemAndInteger(AsnObjectIdentifier *dst,
static INT setOidWithItemAndInteger(AsnObjectIdentifier *dst,
AsnObjectIdentifier *base, UINT item, UINT instance)
{
AsnObjectIdentifier oid;
INT ret;
setOidWithItem(dst, base, item);
oid.idLength = 1;
oid.ids = &instance;
SnmpUtilOidAppend(dst, &oid);
ret = setOidWithItem(dst, base, item);
if (ret)
{
oid.idLength = 1;
oid.ids = &instance;
ret = SnmpUtilOidAppend(dst, &oid);
}
return ret;
}
static struct structToAsnValue mib2IfEntryMap[] = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment