diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-04-03 13:51:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-03 13:51:40 -0700 |
commit | 7a2bca54f0194d7a4c5362e8e2a969ce54a367ba (patch) | |
tree | 5879ec88dce1b8132182e74909867d5196f2c415 /libpod/image/search.go | |
parent | 42757c18553bb2e6865efed4c912e3361012c49c (diff) | |
parent | c6255537d9b65326a3bdd1856f700425ecb71367 (diff) | |
download | podman-7a2bca54f0194d7a4c5362e8e2a969ce54a367ba.tar.gz podman-7a2bca54f0194d7a4c5362e8e2a969ce54a367ba.tar.bz2 podman-7a2bca54f0194d7a4c5362e8e2a969ce54a367ba.zip |
Merge pull request #2651 from mheon/prevent_null_deref
Fix a potential segfault in podman search
Diffstat (limited to 'libpod/image/search.go')
-rw-r--r-- | libpod/image/search.go | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/libpod/image/search.go b/libpod/image/search.go index 2c66ce284..03a67636b 100644 --- a/libpod/image/search.go +++ b/libpod/image/search.go @@ -2,7 +2,6 @@ package image import ( "context" - "reflect" "strconv" "strings" "sync" @@ -10,7 +9,6 @@ import ( "github.com/containers/image/docker" "github.com/containers/image/types" sysreg "github.com/containers/libpod/pkg/registries" - "github.com/fatih/camelcase" "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/sync/semaphore" @@ -63,24 +61,6 @@ type SearchFilter struct { IsOfficial types.OptionalBool } -func splitCamelCase(src string) string { - entries := camelcase.Split(src) - return strings.Join(entries, " ") -} - -// HeaderMap returns the headers of a SearchResult. -func (s *SearchResult) HeaderMap() map[string]string { - v := reflect.Indirect(reflect.ValueOf(s)) - values := make(map[string]string, v.NumField()) - - for i := 0; i < v.NumField(); i++ { - key := v.Type().Field(i).Name - value := key - values[key] = strings.ToUpper(splitCamelCase(value)) - } - return values -} - // SearchImages searches images based on term and the specified SearchOptions // in all registries. func SearchImages(term string, options SearchOptions) ([]SearchResult, error) { |