mirror of
https://github.com/cocktailpeanut/dalai
synced 2024-11-23 04:16:53 +01:00
Prevent Shell Injection
This commit is contained in:
parent
c5349d066e
commit
7aa00916aa
4
index.js
4
index.js
@ -175,9 +175,9 @@ class Dalai {
|
||||
|
||||
let chunks = []
|
||||
for(let key in o) {
|
||||
chunks.push(`--${key} ${o[key]}`)
|
||||
chunks.push(`--${key} ${o[key].toString().replaceAll('"', '\\"')}`)
|
||||
}
|
||||
chunks.push(`-p "${req.prompt}"`)
|
||||
chunks.push(`-p "${req.prompt.replaceAll('"', '\\"')}"`)
|
||||
|
||||
const main_bin_path = platform === "win32" ? path.resolve(this.home, Core, "build", "Release", "llama") : path.resolve(this.home, Core, "main")
|
||||
if (req.full) {
|
||||
|
Loading…
Reference in New Issue
Block a user