From 33366a2cda518fafed0e72cf6e53b55abfa3c5e5 Mon Sep 17 00:00:00 2001 From: TomSweeneyRedHat Date: Thu, 24 Sep 2020 19:33:34 -0400 Subject: Convert Split() calls with an equal sign to SplitN() After seeing #7759, I decided to look at the calls in Podman and Buildah to see if we had issues with strings.Split() calls where an "=" (equals) sign was in play and we expected to split on only the first one. There were only one or two that I found in here that I think might have been troubling, the remainder are just adding some extra safety. I also had another half dozen or so that were checking length expectations appropriately, those I left alone. Signed-off-by: TomSweeneyRedHat --- libpod/image/search.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpod/image/search.go') diff --git a/libpod/image/search.go b/libpod/image/search.go index 5f5845989..b9acf4a20 100644 --- a/libpod/image/search.go +++ b/libpod/image/search.go @@ -263,7 +263,7 @@ func searchRepositoryTags(registry, term string, sc *types.SystemContext, option func ParseSearchFilter(filter []string) (*SearchFilter, error) { sFilter := new(SearchFilter) for _, f := range filter { - arr := strings.Split(f, "=") + arr := strings.SplitN(f, "=", 2) switch arr[0] { case "stars": if len(arr) < 2 { -- cgit v1.2.3-54-g00ecf