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

Fix truncated command-line shown in the web interface #1168

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

Jalle19
Copy link
Collaborator

@Jalle19 Jalle19 commented Aug 6, 2024

When building state.json, the maximum string length was limited to 200 bytes. This means that very long command-lines cannot be represented, leading to escape_json_string:179 buffer size too small (199).

For example:

/usr/local/bin/minisatip-dvbs2-proxy -f -R /usr/local/share/minisatip-dvbs2-proxy/html/ -I minisatip-dvbs2-proxy -w 10.110.4.14:8080 -U 10.110.4.14 -V 10.110.4.14 -D 414 -R /usr/local/share/minisatip-dvbs2-proxy/html -z /var/cache/minisatip-dvbs2-proxy -s *dvbs2:10.110.4.11 -s *dvbs2:10.110.4.12 -s *dvbs2:10.110.4.11 -s *dvbs2:10.110.4.12 -s *dvbs2:10.110.4.11 -s *dvbs2:10.110.4.12 -s *dvbs2:10.110.4.11 -s *dvbs2:10.110.4.12 -A 0:0:0,0:1:0,0:2:0,0:3:0,0:4:0,0:5:0,1:6:1,1:7:1 -l general

With this change, the maximum length is increased to 1 KiB, and the memory is allocated on the heap instead.

Jalle19 added 2 commits August 6, 2024 13:53
Fixes "escape_json_string:179 buffer size too small (199)" from /state.json when the command line used to run minisatip is longer than 200 characters (happens easily if all paths must be overriden)
@Jalle19 Jalle19 requested a review from catalinii August 6, 2024 11:12
@Jalle19 Jalle19 merged commit bd74be8 into catalinii:master Aug 6, 2024
10 checks passed
@Jalle19 Jalle19 deleted the json-string-length branch August 6, 2024 19:29
@Jalle19
Copy link
Collaborator Author

Jalle19 commented Aug 7, 2024

SyntaxError: JSON.parse: unterminated string at line 43 column 124483 of the JSON data

Not sure how this happened, will investigate

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

Successfully merging this pull request may close these issues.

2 participants