Skip to content

[Bug]: Nil pointer dereference in ToDockerV2AuthString() #97

Description

@AR21SM

Description

In pkg/provider/models/models.go (lines 108-110), there's a nil check for Username but not for Password. If a user provides a username without a password, the code will panic.

Location: pkg/provider/models/models.go:108-110

if r.Username != nil {
    authConfig.Username = *r.Username
    authConfig.Password = *r.Password  // panic if Password is nil
}

Expected behavior

Add nil check for Password:

if r.Username != nil && r.Password != nil {
    authConfig.Username = *r.Username
    authConfig.Password = *r.Password
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions