[quagga-dev 4404] Re: Segfault in lib/smux.c

Pierre-Yves Ritschard pierre-yves at spootnik.org
Tue Sep 26 14:28:10 BST 2006


>
> Wouldn't the proper fix generally be to call asn_build_int as follows?
>
>    ptr = asn_build_int (ptr, &len,
> 			(u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER),
> 			&val, sizeof (val));
>
> I think that's what the designers of the API had in mind to reduce
> the chance for mistakes.  And that's the style used inside net-snmp.
>
> This style was followed in the lib/smux.c:smux_getresp_send function,
> but was sadly abandoned elsewhere...
>

I wondered about that too, I thought it would be best, but since sizeof
(int) was used before I thought it was a style decision, Here's a reworked
patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: quagga_lib_smux.diff
Type: application/octet-stream
Size: 764 bytes
Desc: not available
URL: <http://lists.quagga.net/pipermail/quagga-dev/attachments/20060926/4756faa8/attachment-0001.obj>


More information about the Quagga-dev mailing list