MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / checkQuotedNewline

Function checkQuotedNewline

tools/bash/security.go:350–362  ·  view source on GitHub ↗
(command string)

Source from the content-addressed store, hash-verified

348}
349
350func checkQuotedNewline(command string) []SecurityFinding {
351 inSingle, inDouble := false, false
352 for _, ch := range command {
353 if ch == '\'' && !inDouble {
354 inSingle = !inSingle
355 } else if ch == '"' && !inSingle {
356 inDouble = !inDouble
357 } else if (ch == '\n' || ch == '\r') && (inSingle || inDouble) {
358 return []SecurityFinding{{ID: CheckQuotedNewline, Description: "Newline inside quoted string"}}
359 }
360 }
361 return nil
362}
363
364func checkIncompleteCommands(command string) []SecurityFinding {
365 trimmed := strings.TrimSpace(command)

Callers 1

RunAllSecurityChecksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected