[Xorp-hackers] BGP SubnetRoute[Const]Ref copy constructor doesn't check for a NULL route

Euan Harris euan.harris at cl.cam.ac.uk
Fri Jul 27 02:24:02 PDT 2007


Hi,

The copy constructor in BGP's SubnetRouteRef and SubnetRouteConstRef  
doesn't check whether the route pointed to by the Ref it is copying  
is NULL before calling bump_refcount on it.   The main constructor  
does check, so it is possible to construct a Ref to a NULL route  
without any trouble but cause a segfault when some other part of the  
program tries to copy it.  This might happen when you try to insert  
the reference into a RefTrie.

I've attached a tiny patch that adds the required check.   I don't  
think this problem will come up in the current Xorp code because it  
does not store NULL routes.

Thanks,
Euan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: subnetrouteref-null.patch.gz
Type: application/x-gzip
Size: 328 bytes
Desc: not available
Url : http://mailman.ICSI.Berkeley.EDU/pipermail/xorp-hackers/attachments/20070727/d8ca07b4/attachment.gz 


More information about the Xorp-hackers mailing list