diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-01-05 12:44:49 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-01-05 12:50:29 +0100 |
| commit | d646e21ff436cd2a40b23314436cd53f21ae9500 (patch) | |
| tree | c6a58928ecfbef09b335d19a6d8c20884203b688 /prog/encoding.go | |
| parent | c5f5069930ee90925617ded2e413bc99716eb559 (diff) | |
prog: fix tests for string enforcement
String value enforcement broke a number of tests
where we use different values.
Be more string as to what string values we use in tests.
Required to add tmpfs descriptions to test syz_mount_image.
Also special-casing AF_ALG algorithms as these are auto-generated.
Diffstat (limited to 'prog/encoding.go')
| -rw-r--r-- | prog/encoding.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/prog/encoding.go b/prog/encoding.go index f288dbc93..7c5dab10f 100644 --- a/prog/encoding.go +++ b/prog/encoding.go @@ -542,7 +542,9 @@ func (p *parser) parseArgString(t Type) (Arg, error) { data = append(data, make([]byte, diff)...) } data = data[:size] - if typ.Kind == BufferString && len(typ.Values) != 0 { + if typ.Kind == BufferString && len(typ.Values) != 0 && + // AUTOGENERATED will be padded by 0's. + !strings.HasPrefix(typ.Values[0], "AUTOGENERATED") { matched := false for _, val := range typ.Values { if string(data) == val { |
