Skip to content

Commit c0d6c4c

Browse files
kolyshkindrakenclimber
authored andcommitted
MakeCondition: use sanitizeCompareOp
The sanitizeCompareOp function was added by the initial commit but never ever used, thus the "unused" linter complains. Looking at the code, this probably meant to be used from MakeCondition, which already have a check for the comparison argument, but it only checks for non-zero value. Signed-off-by: Kir Kolyshkin <[email protected]> Acked-by: Paul Moore <[email protected]> Signed-off-by: Tom Hromatka <[email protected]>
1 parent e947d82 commit c0d6c4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

seccomp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,8 @@ func MakeCondition(arg uint, comparison ScmpCompareOp, values ...uint64) (ScmpCo
561561
return condStruct, err
562562
}
563563

564-
if comparison == CompareInvalid {
565-
return condStruct, fmt.Errorf("invalid comparison operator")
564+
if err := sanitizeCompareOp(comparison); err != nil {
565+
return condStruct, err
566566
} else if arg > 5 {
567567
return condStruct, fmt.Errorf("syscalls only have up to 6 arguments (%d given)", arg)
568568
} else if len(values) > 2 {

0 commit comments

Comments
 (0)