Skip to content

Possible division by zero #14

@Bbulatov

Description

@Bbulatov

Hello!
During the static analysis was found possible mistake:

  1. Variable int64(len(h.handlers)), whose possible value set allows a zero value at pool.go:45, is used as a denominator at pool.go:45.
func (h *PoolHandler) Handle(ctx context.Context, r slog.Record) error {
	// round robin
	rand := h.randSource.Int63() % int64(len(h.handlers))
	handlers := append(h.handlers[rand:], h.handlers[:rand]...)

Please clarify whether this requires correction?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions