Skip to content

Fix IL2PTX config parsing #483

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

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix IL2PTX config parsing
We were checking `*t` for end of string instead of `*c`, but `t` never changes, so we would run off of the end of the buffer and output a very large number of config errors before eventually crashing.
  • Loading branch information
arodland authored Jul 17, 2023
commit 4bb4109a2dc4ad31bd5e4db4234714de4e5cd35a
2 changes: 1 addition & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2380,7 +2380,7 @@ void config_init (char *fname, struct audio_s *p_audio_config,
p_audio_config->achan[channel].il2p_invert_polarity = 0;

while ((t = split(NULL,0)) != NULL) {
for (char *c = t; *t != '\0'; c++) {
for (char *c = t; *c != '\0'; c++) {
switch (*c) {
case '+':
p_audio_config->achan[channel].il2p_invert_polarity = 0;
Expand Down