[Xorp-hackers] Potential null pointer dereference.

Ben Greear greearb at candelatech.com
Tue Feb 26 11:43:06 PST 2008


While merging my old patch set with the latest xorp tree, I believe
I found a potential null pointer dereference.  Here is my attempt
at fixing it:

[greearb at file-server control_socket]$ cvs diff -u netlink_socket_utilities.cc
Index: netlink_socket_utilities.cc
===================================================================
RCS file: /cvs/xorp/fea/data_plane/control_socket/netlink_socket_utilities.cc,v
retrieving revision 1.12
diff -u -r1.12 netlink_socket_utilities.cc
--- netlink_socket_utilities.cc 8 Jan 2008 23:30:09 -0000       1.12
+++ netlink_socket_utilities.cc 26 Feb 2008 19:40:36 -0000
@@ -332,9 +332,10 @@
         const IfTreeVif* vifp = iftree.find_vif(if_index);
         if (vifp == NULL) {
             if (! is_deleted) {
-               XLOG_FATAL("Could not find interface and vif for index %d",
+               XLOG_ERROR("Could not find interface and vif for index %d",
                            if_index);
             }
+           return XORP_ERROR;
         }
         if_name = vifp->ifname();
         vif_name = vifp->vifname();

-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



More information about the Xorp-hackers mailing list