mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2024-12-14 11:57:51 +00:00
Merge pull request #462 from marquiz/fixes/regexp
pkg/utils: fix possible segfault in RegexpVal.Set
This commit is contained in:
commit
b72b5f751a
1 changed files with 3 additions and 1 deletions
|
@ -33,7 +33,9 @@ type RegexpVal struct {
|
|||
// Set implements the flag.Value interface
|
||||
func (a *RegexpVal) Set(val string) error {
|
||||
r, err := regexp.Compile(val)
|
||||
a.Regexp = *r
|
||||
if err == nil {
|
||||
a.Regexp = *r
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue