Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no len check on active pipelines remove / update methods #204

Closed
Skarlso opened this issue Aug 19, 2019 · 0 comments
Closed

There is no len check on active pipelines remove / update methods #204

Skarlso opened this issue Aug 19, 2019 · 0 comments
Labels

Comments

@Skarlso
Copy link
Member

Skarlso commented Aug 19, 2019

// Update updates a pipeline at the given index with the given pipeline.
func (ap *ActivePipelines) Update(index int, p gaia.Pipeline) {
	ap.Lock()
	defer ap.Unlock()

	ap.Pipelines[index] = p
}

// Remove removes a pipeline at the given index from ActivePipelines.
func (ap *ActivePipelines) Remove(index int) {
	ap.Lock()
	defer ap.Unlock()

	ap.Pipelines = append(ap.Pipelines[:index], ap.Pipelines[index+1:]...)
}

These can and do cause index out of bounds errors.

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

No branches or pull requests

1 participant