From c7734aff73acc8a91b7c0e017f28a0f53d879954 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Jul 2026 07:22:28 +0000 Subject: [PATCH 1/2] Initial plan From be9cbd77b69cfd19bb83a3997cd570b674618a26 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Jul 2026 07:25:22 +0000 Subject: [PATCH 2/2] Fix non-constant format string (CWE-134) in netcomplexity.cc --- src/netcomplexity.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/netcomplexity.cc b/src/netcomplexity.cc index 0f28cae..ab76aef 100644 --- a/src/netcomplexity.cc +++ b/src/netcomplexity.cc @@ -334,7 +334,7 @@ namespace ecolab const int read_pipe=0, write_pipe=1; int pipes[2]; if (pipe(pipes)!=0) - throw error(strerror(errno)); + throw error("%s", strerror(errno)); // now fork child processes to try Nauty and SuperNOVA simultaneously vector children; @@ -347,18 +347,18 @@ namespace ecolab // TODO: not sure that throwing an exception in these // circumstances helps much if (write(pipes[write_pipe], &r, sizeof(r))==-1) - throw error(strerror(errno)); + throw error("%s", strerror(errno)); int w=0; if (write(pipes[write_pipe], &w, sizeof(w))==-1) - throw error(strerror(errno)); + throw error("%s", strerror(errno)); close(pipes[write_pipe]); close(pipes[0]); close(pipes[1]); exit(0); } else if (children.back() == -1) - throw error(strerror(errno)); + throw error("%s", strerror(errno)); children.push_back(fork()); if (children.back()==0) @@ -366,15 +366,15 @@ namespace ecolab BitRep canon; double r=canonical(canon,g); //SuperNOVA version if (write(pipes[write_pipe], &r, sizeof(r))==-1) - throw error(strerror(errno)); + throw error("%s", strerror(errno)); int w=1; if (write(pipes[write_pipe], &w, sizeof(w))==-1) - throw error(strerror(errno)); + throw error("%s", strerror(errno)); close(pipes[0]); close(pipes[1]); exit(0); } else if (children.back() == -1) - throw error(strerror(errno)); + throw error("%s", strerror(errno)); // Bliss (from igraph) produces errors occasionally. Until this is // resolved, disable from the complexity calculation @@ -387,15 +387,15 @@ namespace ecolab // { // double r=igraph_lnomega(g, method); // if (write(pipes[write_pipe], &r, sizeof(r))==-1) -// throw error(strerror(errno)); +// throw error("%s", strerror(errno)); // int w=1; // if (write(pipes[write_pipe], &w, sizeof(w))==-1) -// throw error(strerror(errno)); +// throw error("%s", strerror(errno)); // close(pipes[0]); close(pipes[1]); // exit(0); // } // else if (children.back() == -1) -// throw error(strerror(errno)); +// throw error("%s", strerror(errno)); // } //#endif @@ -403,7 +403,7 @@ namespace ecolab int winner; if (read(pipes[read_pipe],&r,sizeof(r))==-1 || read(pipes[read_pipe],&winner,sizeof(winner))==-1) - throw error(strerror(errno)); + throw error("%s", strerror(errno)); for (size_t i=0; i