Skip to content

Commit 560fa09

Browse files
committed
fix checkQuoteSize so it logs
1 parent df6fa5e commit 560fa09

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pkg/util/shellutil/shellquote.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33

44
package shellutil
55

6-
import "regexp"
6+
import (
7+
"log"
8+
"regexp"
9+
)
710

811
const (
912
MaxQuoteSize = 10000000 // 10MB
@@ -150,5 +153,9 @@ func SoftQuote(s string) string {
150153
}
151154

152155
func checkQuoteSize(s string) bool {
153-
return len(s) < MaxQuoteSize
156+
if len(s) > MaxQuoteSize {
157+
log.Printf("string too long to quote: %s", s)
158+
return false
159+
}
160+
return true
154161
}

0 commit comments

Comments
 (0)