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

Chore: new json compilation mechanism #623

Open
akvlad opened this issue Mar 11, 2025 · 0 comments
Open

Chore: new json compilation mechanism #623

akvlad opened this issue Mar 11, 2025 · 0 comments

Comments

@akvlad
Copy link
Collaborator

akvlad commented Mar 11, 2025

What

Switch from fmt.Sprintf to json-iterator json creation method.

Why

CodeQL reported about a set of potentially vulnerable places in the code where json is compiled using fmt.Sprintf. The most concerning parts are already replaced. We have to refactor the rest.

How

  1. Find all the functions where json is created using fmt.Sprintf and enumerate them.
  2. Replace the fmt.Sprintf with json-iterator library as it is done here: https://github.com/metrico/qryn/blob/gigapipe/reader/service/queryRangeService.go#L226-L324
  3. Make sure that all the tests are passed.
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