mirror of
https://github.com/mborgerding/kissfft.git
synced 2026-08-30 22:07:01 -04:00
Fix High severity coverity finding:
CWE-78(OS Commadn injection (https://cwe.mitre.org/data/definitions/78.html)
This commit is contained in:
+4
-5
@@ -100,15 +100,14 @@ def dofft(x, isreal):
|
|||||||
x = 2147483647.0 * x
|
x = 2147483647.0 * x
|
||||||
scale = len(x) / 2147483647.0
|
scale = len(x) / 2147483647.0
|
||||||
|
|
||||||
cmd = util + ' -n '
|
cmd = [util, '-n', ','.join([str(d) for d in dims])]
|
||||||
cmd += ','.join([str(d) for d in dims])
|
|
||||||
if do_real:
|
if do_real:
|
||||||
cmd += ' -R '
|
cmd.append('-R')
|
||||||
|
|
||||||
print(cmd)
|
print(' '.join(cmd))
|
||||||
|
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE)
|
p = Popen(cmd, stdin=PIPE, stdout=PIPE)
|
||||||
|
|
||||||
p.stdin.write(dopack(x))
|
p.stdin.write(dopack(x))
|
||||||
p.stdin.close()
|
p.stdin.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user