1
0
Fork 0
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:
Kubernetes Prow Robot 2021-03-04 07:48:10 -08:00 committed by GitHub
commit b72b5f751a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}