Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix overflows with malformed lesskey lines (#234)
If lines are malformed it is possible to trigger out of boundary read accesses during parsing. Carefully handle the pointer increments to not move behind the terminating nul byte. How to reproduce: python -c 'print(1022*" "+"\\")' > lesskey-1.txt python -c 'print(1022*" "+"^")' > lesskey-2.txt python -c 'print(1021*" "+"\\k")' > lesskey-3.txt Open these files with lesskey, compiled with -fsanitize=address.
- Loading branch information