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

Error: unable to parse link to update line number #2052

Closed
rgmz opened this issue Oct 30, 2023 · 2 comments
Closed

Error: unable to parse link to update line number #2052

rgmz opened this issue Oct 30, 2023 · 2 comments
Labels

Comments

@rgmz
Copy link
Contributor

rgmz commented Oct 30, 2023

Please review the Community Note before submitting

TruffleHog Version

3.61.0

Description

Scanning a file with the path meta-xilinx/meta-xilinx-contrib/recipes-kernel/linux-firmware/linux-firmware_%.bbappend (escaped as %25 in the url) produces the following error:

2023-10-30T09:13:31-04:00       error   trufflehog      unable to parse link to update line number
{
  "detector_worker_id": "e4wt4",
  "timeout": 10,
  "link": "https://github.com/ibm-openbmc/openbmc/blob/286d45cc649a5b852a27b48e61b51bf75e9d1cee/meta-xilinx/meta-xilinx-contrib/recipes-kernel/linux-firmware/linux-firmware_%.bbappend#L1",
  "error": "parse \"https://github.com/ibm-openbmc/openbmc/blob/286d45cc649a5b852a27b48e61b51bf75e9d1cee/meta-xilinx/meta-xilinx-contrib/recipes-kernel/linux-firmware/linux-firmware_%.bbappend\": invalid URL escape \"%.b\""
}

I'm not sure if there's anything that can be done to combat this. The error seems to be coming from url.Parse.

parsedURL, err := url.Parse(link)
if err != nil {
ctx.Logger().Error(err, "unable to parse link to update line number", "link", link)
return link
}

@rgmz rgmz added the bug label Oct 30, 2023
@rgmz
Copy link
Contributor Author

rgmz commented Nov 14, 2023

This issue should be easily solved by replacing % with %25 prior to calling url.Parse.

https://en.wikipedia.org/wiki/Percent-encoding

@rgmz
Copy link
Contributor Author

rgmz commented Dec 14, 2023

Fixed by #2214.

@rgmz rgmz closed this as completed Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant