On Sun, Oct 23, 2011 at 01:01:13PM +0200, Bart Van Assche wrote:
> Hi,
> 
> While reviewing the source code in
> agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c I came across
> this:
> 
> @@ -215,6 +215,13 @@
> _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container
> *container,
>              continue;
>          }
> 
> +        /* restore the interface name if we modifed it due to unaliasing
> +         * above
> +         */
> +        if (entry->flags | NETSNMP_ACCESS_IPADDRESS_ISALIAS) {
> +            memcpy(ifrp->ifr_name, extras->name, sizeof(extras->name));
> +        }
> +
>          /*
>           * get broadcast
>           */
> 
> Am I the only one who considers this code as obviously broken ?

No. I agree, it seems to always copy 4 or 8 bytes. Good catch.

/MF

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to