File tree 4 files changed +20
-22
lines changed
4 files changed +20
-22
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,17 @@ bool taint_do_security_scan(
190
190
{
191
191
const boost::filesystem::path results_dir =
192
192
config.get_slicer_root_directory ();
193
+
194
+ const auto ignore = std::system (
195
+ (std::string (" dot -Tsvg \" " ) +
196
+ (results_dir / " propagation_chains.dot" ).native () + " \" -o \" " +
197
+ (results_dir / " propagation_chains.svg" ).native () + " \" " )
198
+ .c_str ());
199
+ (void )ignore; // We do not care about the return value, because
200
+ // if the call fails, then the link to the SVG
201
+ // image in the debug HTML output won't work.
202
+ // That is all.
203
+
193
204
const std::string svg_path =
194
205
(results_dir / " tokens_propagation_graph.svg" ).native ();
195
206
Original file line number Diff line number Diff line change @@ -500,25 +500,14 @@ std::ostream &to_dot(
500
500
return ostr;
501
501
}
502
502
503
- void dump_as_svg (
503
+ void to_dot (
504
504
const taint_propagation_chainst &chains,
505
- const std::string &svg_file_pathname )
505
+ const std::string &dot_file_pathname )
506
506
{
507
- std::string const dot_filename =
508
- boost::filesystem::path (svg_file_pathname).replace_extension (" dot" )
509
- .native ();
510
- {
511
- std::fstream ostr (dot_filename, std::ios_base::out);
512
- if (!ostr.is_open ())
513
- return ;
514
- to_dot (chains,ostr);
515
- }
516
-
517
- std::string const command =
518
- msgstream () << " dot -Tsvg \" " << dot_filename
519
- << " \" -o \" " << svg_file_pathname << " \" " ;
520
- const auto x=std::system (command.c_str ());
521
- (void )x;
507
+ std::fstream ostr (dot_file_pathname, std::ios_base::out);
508
+ if (!ostr.is_open ())
509
+ return ;
510
+ to_dot (chains, ostr);
522
511
}
523
512
524
513
std::ostream &operator <<(std::ostream &ostr, const argidx_and_tokennamet &atp)
Original file line number Diff line number Diff line change @@ -263,8 +263,8 @@ std::ostream &to_dot(
263
263
const taint_propagation_chainst &chains,
264
264
std::ostream &ostr);
265
265
266
- void dump_as_svg (
266
+ void to_dot (
267
267
const taint_propagation_chainst &chains,
268
- const std::string &svg_file_pathname );
268
+ const std::string &dot_file_pathname );
269
269
270
270
#endif
Original file line number Diff line number Diff line change @@ -73,9 +73,7 @@ void taint_slicert::compute_slice(
73
73
map_from_functions_to_rule_application_sites,
74
74
statistics);
75
75
76
- dump_as_svg (
77
- propagation_chains,
78
- (results_dir / " propagation_chains.svg" ).native ());
76
+ to_dot (propagation_chains, (results_dir / " propagation_chains.dot" ).native ());
79
77
80
78
std::vector<taint_instrumentation_propst> instrumentation_props;
81
79
taint_build_instrumentation_props (
You can’t perform that action at this time.
0 commit comments