Skip to content

Wrong implementation of ListHandlers in inbound.go #4956

@mostafa3dmax

Description

@mostafa3dmax

Integrity requirements

  • I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • I provided the complete config and logs, rather than just providing the truncated parts based on my own judgment.
  • I searched issues and did not find any similar issues.
  • The problem can be successfully reproduced in the latest Release

Description

Bug Report: Wrong implementation of ListHandlers in inbound.go

In app/proxyman/inbound/inbound.go, the ListHandlers method has an incorrect usage of the copy function.

Currently, it is written as:

copy(m.untaggedHandler, response)

However, this does not copy anything into response, because response is nil at that point.

It should be:

response := make([]inbound.Handler, len(m.untaggedHandler))
copy(response, m.untaggedHandler)

Without this fix, ListHandlers returns an empty list even when untaggedHandler is populated.

Thanks!

Reproduction Method

response := make([]inbound.Handler, len(m.untaggedHandler))
copy(response, m.untaggedHandler)

Client config


Server config


Client log


Server log


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions