Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Fix nil pointer dereference in auth config #4891

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

izeau
Copy link

@izeau izeau commented Aug 16, 2023

Hello!

I noticed some nil pointer dereference in the deploy stage using this (basic) configuration:

project = "pet-shop"

app "api" {
  build {
    use "docker" {}

    registry {
      use "docker" {
        insecure = true
        image    = "registry.waypoint:5000/pet-shop-api"
        tag      = gitrefpretty()
      }
    }
  }

  deploy {
    use "docker" {
      service_port = 80
    }
  }
}

It looks like the pullImage function in builtin/docker/platform.go checks if the auth block is empty or not, but fails to check for nil. After taking a quick look around, I found this bug in 3 more cases. I applied the same reasoning as @catsby in e5b5fe9 to fix them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant