Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
7735b4bd
Commit
7735b4bd
authored
Sep 03, 2003
by
Robert Ricci
Browse files
Fix some really dumb segfaults if link endpoints didn't exist.
parent
8bf48bc3
Changes
2
Hide whitespace changes
Inline
Side-by-side
assign/parse_ptop.cc
View file @
7735b4bd
...
...
@@ -193,6 +193,16 @@ int parse_ptop(tb_pgraph &PG, tb_sgraph &SG, istream& i)
}
#define ISSWITCH(n) (n->types.find("switch") != n->types.end())
// Check to make sure the nodes in the link actually exist
if
(
pname2vertex
.
find
(
src
)
==
pname2vertex
.
end
())
{
ptop_error
(
"Bad link line, non-existent node."
);
continue
;
}
if
(
pname2vertex
.
find
(
dst
)
==
pname2vertex
.
end
())
{
ptop_error
(
"Bad link line, non-existent node."
);
continue
;
}
pvertex
srcv
=
pname2vertex
[
src
];
pvertex
dstv
=
pname2vertex
[
dst
];
tb_pnode
*
srcnode
=
get
(
pvertex_pmap
,
srcv
);
...
...
assign/parse_top.cc
View file @
7735b4bd
...
...
@@ -162,6 +162,16 @@ int parse_top(tb_vgraph &VG, istream& i)
}
vedge
e
;
// Check to make sure the nodes in the link actually exist
if
(
vname2vertex
.
find
(
src
)
==
vname2vertex
.
end
())
{
top_error
(
"Bad link line, non-existent node."
);
continue
;
}
if
(
vname2vertex
.
find
(
dst
)
==
vname2vertex
.
end
())
{
top_error
(
"Bad link line, non-existent node."
);
continue
;
}
vvertex
node1
=
vname2vertex
[
src
];
vvertex
node2
=
vname2vertex
[
dst
];
e
=
add_edge
(
node1
,
node2
,
VG
).
first
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment