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

[Bug] go 1.22 编译程序运行报错,panic: encoding alphabet includes duplicate symbols #469

Open
poneding opened this issue Apr 12, 2024 · 0 comments

Comments

@poneding
Copy link

使用 go1.22 版本编译 openrasp 程序运行将报错:

image

这是因为go 1.22版本中 base64.NewEncoding 函数对入参增加了新的验证:不可重复字符,参考:encoding: require unique alphabet for base32 and base64

源码定位OPQRSTYZabcdefgABCDEFGHIJKLMNhijklmnopqrUVWXstuvwxyz01234567891q 包含重复字符 1 和 q,所以 程序运行至此会直接 panic。

建议调整为使用 base64.StdEncoding.EncodeToString 函数。

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

No branches or pull requests

1 participant