mirror of
https://github.com/containers/podman.git
synced 2025-09-22 04:03:48 +08:00
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 <tsweeney@redhat.com>
This commit is contained in:
@ -474,8 +474,8 @@ func getTomlStorage(storeOptions *storage.StoreOptions) *tomlConfig {
|
||||
config.Storage.RunRoot = storeOptions.RunRoot
|
||||
config.Storage.GraphRoot = storeOptions.GraphRoot
|
||||
for _, i := range storeOptions.GraphDriverOptions {
|
||||
s := strings.Split(i, "=")
|
||||
if s[0] == "overlay.mount_program" {
|
||||
s := strings.SplitN(i, "=", 2)
|
||||
if s[0] == "overlay.mount_program" && len(s) == 2 {
|
||||
config.Storage.Options.MountProgram = s[1]
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user