aboutsummaryrefslogtreecommitdiffstats
path: root/prog/encoding.go
diff options
context:
space:
mode:
Diffstat (limited to 'prog/encoding.go')
-rw-r--r--prog/encoding.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/prog/encoding.go b/prog/encoding.go
index 92b7f2be3..82c93273a 100644
--- a/prog/encoding.go
+++ b/prog/encoding.go
@@ -597,6 +597,15 @@ func (p *parser) parseArgString(t Type, dir Dir) (Arg, error) {
if err != nil {
return nil, err
}
+ // Check compressed data for validity.
+ if typ.IsCompressed() {
+ _, err = Decompress(data)
+ if err != nil {
+ p.strictFailf("invalid compressed data in arg: %v", err)
+ // In non-strict mode, empty the data slice.
+ data = Compress([]byte{})
+ }
+ }
size := ^uint64(0)
if p.Char() == '/' {
p.Parse('/')