1
mirror of https://github.com/cocktailpeanut/dalai synced 2025-03-24 12:24:22 +01:00

Prevent Shell Injection

This commit is contained in:
jelly 2023-03-17 18:59:44 +09:00
parent c5349d066e
commit 7aa00916aa

@ -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) {