Re: MAC address in ifPhyAddress

Tsolakos Stavros <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi!

> case TR_MIB_STR :
> value = (char *) val->s;
>         if (!value) {
>             value = "";
>         }
>         TR_DEBUG_D(TR_SNMP_DEBUG_REQ, "Returning value type 
> ASN_OCTET_STR, value %s", value);
>         snmp_set_var_typed_value(idx, ASN_OCTET_STR, value, strlen(value));
> 

No, no, no! 'value' is not NULL terminated. strlen could return
anything, and a crash seems inevitable if the MAC address contained no
zeros. Try replacing strlen(value) with 6.

HTH,

Stavros

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.