Skip to content

Commit

Permalink
Fix IL2PTX config parsing (#483)
Browse files Browse the repository at this point in the history
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
1 parent fed79a7 commit c5ad945
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit c5ad945

Please sign in to comment.