Skip to content

Commit 14060bb

Browse files
authored
Merge pull request #69 from fosslight/develop
Fix the vulnerability
2 parents 4cfff6d + 3b20544 commit 14060bb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/fosslight_scanner/fosslight_scanner.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import yaml
1111
import sys
1212
import shutil
13+
import shlex
1314
from pathlib import Path
1415
from datetime import datetime
1516
from fosslight_binary import binary_analysis
@@ -158,9 +159,9 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
158159
else: # Run fosslight_source by using docker image
159160
src_output = os.path.join("output", output_files["SRC"])
160161
output_rel_path = os.path.relpath(abs_path, os.getcwd())
161-
command = f"docker run -it -v {_output_dir}:/app/output "\
162-
f"fosslight -p {output_rel_path} -o {src_output}.xlsx"
163-
command_result = subprocess.run(command.split(' '), stdout=subprocess.PIPE, text=True)
162+
command = shlex.quote(f"docker run -it -v {_output_dir}:/app/output "
163+
f"fosslight -p {output_rel_path} -o {src_output}")
164+
command_result = subprocess.run(command, stdout=subprocess.PIPE, text=True)
164165
logger.info(f"Source Analysis Result:{command_result.stdout}")
165166

166167
except Exception as ex:

0 commit comments

Comments
 (0)