Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix infinite loop in
split_by_comma_or_colon()
. (#1332)
* Fix infinite loop in `split_by_comma_or_colon()`. The mere presence of a `,` or a `:` in the input string would make the function enter an infinite loop, effectively freezing the program until all available memory was exhausted. The string position in the loop was not incremented past the `,` or the `;` character that had just been read. The function is currently used only in the `--exclude-libs` option. The freeze is reproducible with: ```bash $ mold --exclude-libs foo,bar ``` The longer the string after the first `,` or `:` is, the faster memory exhaustion is reached. * Skip empty parts in `split_by_comma_or_colon()`.
- Loading branch information