Prevent possible buffer overflows when using very large (>= 8192 bit) RSA keys.
[tinc] / src / graph.c
index f6ce90d..6ad2566 100644 (file)
@@ -1,7 +1,7 @@
 /*
     graph.c -- graph algorithms
-    Copyright (C) 2001-2004 Guus Sliepen <guus@tinc-vpn.org>,
-                  2001-2004 Ivo Timmermans <ivo@tinc-vpn.org>
+    Copyright (C) 2001-2005 Guus Sliepen <guus@tinc-vpn.org>,
+                  2001-2005 Ivo Timmermans <ivo@tinc-vpn.org>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -226,7 +226,9 @@ void sssp_bfs(void)
                                        free(e->to->hostname);
 
                                e->to->hostname = sockaddr2hostname(&e->to->address);
-                               avl_insert_node(node_udp_tree, node);
+
+                               if(node)
+                                       avl_insert_node(node_udp_tree, node);
 
                                if(e->to->options & OPTION_PMTU_DISCOVERY) {
                                        e->to->mtuprobes = 0;